Skip to content

Commit

Permalink
Merge pull request #95 from schnell3526/main
Browse files Browse the repository at this point in the history
  • Loading branch information
desilinguist authored Dec 20, 2021
2 parents b11e839 + c2ea370 commit 94ac334
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions factor_analyzer/factor_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class FactorAnalyzer(BaseEstimator, TransformerMixin):
If 'randomized', use faster ``randomized_svd``
function from scikit-learn. The latter should only
be used if the number of columns is greater than or
equal to the number of rows in in the dataset.
equal to the number of rows in in the dataset.
Defaults to 'randomized'
rotation_kwargs, optional
Additional key word arguments
Expand Down Expand Up @@ -497,7 +497,7 @@ def _fit_principal(self, X):

# perform the randomized singular value decomposition
if self.svd_method == 'randomized':
U, S, V = randomized_svd(X, self.n_factors)
U, S, V = randomized_svd(X, self.n_factors, random_state=0)
# otherwise, perform the full SVD
else:
U, S, V = np.linalg.svd(X, full_matrices=False)
Expand Down Expand Up @@ -687,11 +687,11 @@ def fit(self, X, y=None):
variance = self._get_factor_variance(loadings)[0]
new_order = list(reversed(np.argsort(variance)))
loadings = loadings[:, new_order].copy()

# if the structure matrix exists, reorder
if structure is not None:
if structure is not None:
structure = structure[:, new_order].copy()

self.phi_ = phi
self.structure_ = structure

Expand Down

0 comments on commit 94ac334

Please sign in to comment.