lei gu
lei gu

Reputation: 31

How to get factor loadings in python with sklearn.decomposition FactorAnalysis

I am running a factor analysis on my stock returns matrix (200*676) using sklearn.decomposition FactorAnalysis. But I don't know how to get the factor loadings. This is how my code looks:

fa = FactorAnalysis(n_components=10, max_iter=30) 
fa.fit(stock_return_matrix) 

Is the fa.components_ factor loadings? If not, how to get the factor loadings?

Upvotes: 3

Views: 2766

Answers (2)

Jason
Jason

Reputation: 3266

The loading matrix is given in fa.components_.

fa.transform() doesn't give the loading matrix, but the estimated latent/hidden variable.

Upvotes: 2

Regi Mathew
Regi Mathew

Reputation: 2873

Yes fa.components_ is the loadings. However, if your study objective include interpretation of Factors, it is better to use a Factor Analysis package that allows rotation (eg:- factor_analyzer).

Upvotes: 1

Related Questions