@@ -179,7 +179,7 @@ class FactorAnalyzer(BaseEstimator, TransformerMixin):
179
179
If 'randomized', use faster ``randomized_svd``
180
180
function from scikit-learn. The latter should only
181
181
be used if the number of columns is greater than or
182
- equal to the number of rows in in the dataset.
182
+ equal to the number of rows in in the dataset.
183
183
Defaults to 'randomized'
184
184
rotation_kwargs, optional
185
185
Additional key word arguments
@@ -497,7 +497,7 @@ def _fit_principal(self, X):
497
497
498
498
# perform the randomized singular value decomposition
499
499
if self .svd_method == 'randomized' :
500
- U , S , V = randomized_svd (X , self .n_factors )
500
+ U , S , V = randomized_svd (X , self .n_factors , random_state = 0 )
501
501
# otherwise, perform the full SVD
502
502
else :
503
503
U , S , V = np .linalg .svd (X , full_matrices = False )
@@ -687,11 +687,11 @@ def fit(self, X, y=None):
687
687
variance = self ._get_factor_variance (loadings )[0 ]
688
688
new_order = list (reversed (np .argsort (variance )))
689
689
loadings = loadings [:, new_order ].copy ()
690
-
690
+
691
691
# if the structure matrix exists, reorder
692
- if structure is not None :
692
+ if structure is not None :
693
693
structure = structure [:, new_order ].copy ()
694
-
694
+
695
695
self .phi_ = phi
696
696
self .structure_ = structure
697
697
0 commit comments