Skip to content

Commit 0b69e7e

Browse files
author
William de Vazelhes
committed
Revert "XP: try to change the way we choose n_components to see if it fixes the test"
This reverts commit e86b61b.
1 parent e86b61b commit 0b69e7e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

metric_learn/_util.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -559,18 +559,13 @@ 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-
# 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,
562+
pca = PCA(n_components=num_dims,
566563
random_state=random_state)
567564
if verbose:
568565
print('Finding principal components... ')
569566
sys.stdout.flush()
570567
pca.fit(input)
571-
# TODO: change here too
572-
transformation = pca.components_[:num_dims]
573-
# transformation = pca.components_
568+
transformation = pca.components_
574569
elif init == 'lda':
575570
lda = LinearDiscriminantAnalysis(n_components=num_dims)
576571
if verbose:

0 commit comments

Comments
 (0)