@@ -389,25 +389,25 @@ def _fit(self, X):
389
389
n_components = self .n_components
390
390
391
391
# Handle svd_solver
392
- svd_solver = self .svd_solver
393
- if svd_solver == 'auto' :
392
+ self . _fit_svd_solver = self .svd_solver
393
+ if self . _fit_svd_solver == 'auto' :
394
394
# Small problem or n_components == 'mle', just call full PCA
395
395
if max (X .shape ) <= 500 or n_components == 'mle' :
396
- svd_solver = 'full'
396
+ self . _fit_svd_solver = 'full'
397
397
elif n_components >= 1 and n_components < .8 * min (X .shape ):
398
- svd_solver = 'randomized'
398
+ self . _fit_svd_solver = 'randomized'
399
399
# This is also the case of n_components in (0,1)
400
400
else :
401
- svd_solver = 'full'
401
+ self . _fit_svd_solver = 'full'
402
402
403
403
# Call different fits for either full or truncated SVD
404
- if svd_solver == 'full' :
404
+ if self . _fit_svd_solver == 'full' :
405
405
return self ._fit_full (X , n_components )
406
- elif svd_solver in ['arpack' , 'randomized' ]:
407
- return self ._fit_truncated (X , n_components , svd_solver )
406
+ elif self . _fit_svd_solver in ['arpack' , 'randomized' ]:
407
+ return self ._fit_truncated (X , n_components , self . _fit_svd_solver )
408
408
else :
409
409
raise ValueError ("Unrecognized svd_solver='{0}'"
410
- "" .format (svd_solver ))
410
+ "" .format (self . _fit_svd_solver ))
411
411
412
412
def _fit_full (self , X , n_components ):
413
413
"""Fit the model by computing full SVD on X"""
0 commit comments