dataset = fetch_olivetti_faces(shuffle=True, random_state=rng)
faces = dataset.images
target = dataset.target
classes = sorted(list(set(target)))
ref_index = [(np.min(np.where(target == index))) for index in classes]
x_ref = faces[ref_index]
y_ref = target[ref_index]
test_index = [index for index in range(len(faces)) if index not in ref_index]
x_test = faces[test_index]