Results of pca are different
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Rajani Mishra
il 13 Feb 2020
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 Commenti
Vedere anche
Categorie
Scopri di più su Dimensionality Reduction and Feature Extraction in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!