Results of pca are different

3 visualizaciones (últimos 30 días)
Ismaele Bnb
Ismaele Bnb el 13 de Nov. de 2019
Respondida: Rajani Mishra el 13 de Feb. de 2020
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

Respuestas (1)

Rajani Mishra
Rajani Mishra el 13 de Feb. de 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.

Categorías

Más información sobre Dimensionality Reduction and Feature Extraction en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by