Skip to content

Commit

Permalink
Merge pull request #51 from keesmulder/patch-1
Browse files Browse the repository at this point in the history
Also re-order the structure matrix
  • Loading branch information
desilinguist authored Jun 2, 2020
2 parents d3df9c6 + 6c07ffb commit 9d712e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions factor_analyzer/factor_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,12 @@ def fit(self, X, y=None):

# resort the factors according to their variance
variance = self._get_factor_variance(loadings)[0]
loadings = loadings[:, list(reversed(np.argsort(variance)))].copy()

new_order = list(reversed(np.argsort(variance)))
loadings = loadings[:, new_order].copy()

if structure is not None:
structure = structure[:, new_order].copy()

self.phi_ = phi
self.structure_ = structure

Expand Down

0 comments on commit 9d712e4

Please sign in to comment.