Results of pca are different
3 ビュー (過去 30 日間)
古いコメントを表示
Hi
I'm doing a porting from matlab to java, and I'm having trouble with PCA. In java i got only first eigenvectors same as matlab's ones. Could this be possible because of explained values are all zeros except for first (that is 100)?
This is matlab function:
[pca_eigenvec, pca_coeff, pca_eigenval, tsquared, explained] = pca(X, 'Economy', false);
Eigenvalues are same, and only first is not zero.
One more thing. If I use first 2 eigenvectors to make a plot, do I get wrong results?
Thanks :D
0 件のコメント
回答 (1 件)
Rajani Mishra
2020 年 2 月 13 日
Output argument “explained” from pca() gives the percentage of the total variance explained by each principal component. Explained value returned for the first one is 100 this means 100 percentage of the total variance(i.e total variance) is explained by the first component itself hence you are getting only first eigenvector.
Since the first component explains 100% of all variability, plotting even the second component won’t give wrong results but you will see only the first component displayed.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!