x******a 发帖数: 6336 | 1 请问explained variance和eigenvalues of covariance matrix什么关系?
多谢! | w*********s 发帖数: 1140 | 2 The ranked eigenvalues are representing the variance explained by the
corresponding PCs.
For example, the variance explained by the first PC is equal to the largest
eigenvalue. | x******a 发帖数: 6336 | 3 thanks, that is what I think. however, I tried the python package sklearn
and statsmodels.sandbox.tools.pca, I got the following result that I don't
understand.
---sklearn-----
pca3.explained_variance_
Out[1001]:
array([ 1.78290607, 1.08429872, 0.42104483, 0.31175038])
---------------
The eigenvalues by statsmodels.sandbox.tools.pca are
array([ 1.98100675, 1.20477635, 0.46782759, 0.34638931])
----------------
the data is:
a b c d
0 0.992009 1.772628e+00 9.369741e-01 1.510715e-01
1 -1.596765 -2.236714e-01 8.703019e-01 1.046825e+00
2 1.064519 -4.164265e-01 -1.728404e+00 -2.151135e+00
3 -1.248263 -7.462143e-01 -5.396282e-01 9.312417e-17
4 0.300384 6.416818e-01 6.970039e-01 1.470260e+00
5 0.000000 6.151180e-18 -1.590554e+00 5.692677e-03
6 1.376652 -7.265441e-01 1.052036e-01 4.298877e-01
7 -0.888537 -6.617251e-02 9.981828e-01 9.312417e-17
8 0.000000 1.315161e+00 2.509203e-01 9.312417e-17
9 0.000000 -1.550441e+00 -6.528411e-17 -9.526020e-01 | k***n 发帖数: 997 | 4 我被启发到了
1.08429872*10/9=1.204776355555556 |
|