Skip to content

Commit e86b61b

Browse files
author
William de Vazelhes
committed
XP: try to change the way we choose n_components to see if it fixes the test
1 parent 5e3daa4 commit e86b61b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

metric_learn/_util.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,18 @@ def _initialize_transformer(num_dims, input, y=None, init='auto',
559559
elif init in {'pca', 'lda'}:
560560
init_time = time.time()
561561
if init == 'pca':
562-
pca = PCA(n_components=num_dims,
562+
# TODO: set back with n_components=num_dims
563+
# pca = PCA(n_components=num_dims,
564+
# random_state=random_state)
565+
pca = PCA(n_components=n_features,
563566
random_state=random_state)
564567
if verbose:
565568
print('Finding principal components... ')
566569
sys.stdout.flush()
567570
pca.fit(input)
568-
transformation = pca.components_
571+
# TODO: change here too
572+
transformation = pca.components_[:num_dims]
573+
# transformation = pca.components_
569574
elif init == 'lda':
570575
lda = LinearDiscriminantAnalysis(n_components=num_dims)
571576
if verbose:

0 commit comments

Comments
 (0)