Skip to content

Commit 94ac334

Browse files
authored
Merge pull request #95 from schnell3526/main
2 parents b11e839 + c2ea370 commit 94ac334

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

factor_analyzer/factor_analyzer.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class FactorAnalyzer(BaseEstimator, TransformerMixin):
179179
If 'randomized', use faster ``randomized_svd``
180180
function from scikit-learn. The latter should only
181181
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.
183183
Defaults to 'randomized'
184184
rotation_kwargs, optional
185185
Additional key word arguments
@@ -497,7 +497,7 @@ def _fit_principal(self, X):
497497

498498
# perform the randomized singular value decomposition
499499
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)
501501
# otherwise, perform the full SVD
502502
else:
503503
U, S, V = np.linalg.svd(X, full_matrices=False)
@@ -687,11 +687,11 @@ def fit(self, X, y=None):
687687
variance = self._get_factor_variance(loadings)[0]
688688
new_order = list(reversed(np.argsort(variance)))
689689
loadings = loadings[:, new_order].copy()
690-
690+
691691
# if the structure matrix exists, reorder
692-
if structure is not None:
692+
if structure is not None:
693693
structure = structure[:, new_order].copy()
694-
694+
695695
self.phi_ = phi
696696
self.structure_ = structure
697697

0 commit comments

Comments
 (0)