Results of pca are different

3 ビュー (過去 30 日間)
Ismaele Bnb
Ismaele Bnb 2019 年 11 月 13 日
回答済み: Rajani Mishra 2020 年 2 月 13 日
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

回答 (1 件)

Rajani Mishra
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.

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by