0
저는 파이썬에서 sklearn을 사용하여 요인 분석을 수행하기 위해 고심하고 있습니다. R에서 파이썬에서의 팩터 분석 (R에서 factal()과 유사)
다음 코드를 실행 한 후 :Call:
factanal(x = data_final, factors = 2, scores = "regression", rotation = "varimax", lower = 0.01)
Uniquenesses:
WTI GOLD CAC40 DAX EUR_DOLL YEN_DOLL SP500 NIKKEI GILT TEN_TRES
0.740 0.971 0.115 0.056 0.789 0.775 0.283 0.022 0.849 0.754
Loadings:
Factor1 Factor2
WTI 0.400 0.317
GOLD 0.169
CAC40 0.857 0.387
DAX 0.903 0.359
EUR_DOLL 0.371 0.271
YEN_DOLL -0.472
SP500 0.511 0.675
NIKKEI 0.337 0.930
GILT -0.334 -0.197
TEN_TRES -0.343 -0.358
Factor1 Factor2
SS loadings 2.482 2.163
Proportion Var 0.248 0.216
Cumulative Var 0.248 0.465
Test of the hypothesis that 2 factors are sufficient.
The chi square statistic is 686.84 on 26 degrees of freedom.
The p-value is 4.16e-128
내가 쉽게이 코드를 해석하고, 그 뒤에 출력과 과정을 이해 할 수
x.f <- factanal(data_final, factors = 2, rotation="varimax", scores="regression", lower = 0.01)
나는 다음과 같은 결과를 얻을.
그러나 파이썬에서 다음 코드를 실행할 때 무슨 일이 일어나고 있는지, 올바른지 확실하지 않습니다.
from sklearn import decomposition
from sklearn.decomposition import FactorAnalysis
factor = decomposition.FactorAnalysis(n_components=2)
factor.fit(data_final.iloc[:, 1::])
factor.components_
array([[-0.01175024, -0.00157749, -0.01547956, -0.01353783, -0.00322834,
0.00225613, -0.01085127, -0.01219159, 0.00247041, 0.00210084],
[ 0.00021618, -0.00135881, -0.00419973, -0.00435391, -0.00012713,
-0.00225637, 0.00275685, 0.00686218, 0.00034337, -0.00035002]])
파이썬에서 요인 분석을 수행하는 더 쉬운 방법이 있습니까? 그렇지 않다면 어떻게 파이썬 코드에서 요소 요소를 얻을 수 있습니까?
내가 사용하는 데이터 세트는 10 가지 자산의 선물 계약 로그 반환 세트입니다. 사전