- X is your data matrix (rows = observations, columns = variables).
- coeff contains the principal component loadings (each column is a principal component).
- score contains the principal component scores. Each column of score corresponds to the coordinates of the data in one principal component direction.
- latent are the eigenvalues (the variance explained by each principal component).
- explained is the percentage of variance explained by each principal component.
- mu is the estimated mean of each variable in X.
what are scores in PCA
6 views (last 30 days)
Show older comments
1.Should i take the scores as the new projected values of the previous values? 2.And if i choose some columns of PCA to delete in order to keep the columns with the best variance for the component then i should delete these columns from the scores? OR the columns selection should be done to the original dataset?
0 Comments
Answers (1)
TED MOSBY
on 25 Mar 2025
Hi Nikos,
In MATLAB, when you perform Principal Component Analysis using the [pca] function, you call:
[coeff, score, latent, tsquared, explained, mu] = pca(X);
Here:
So, the scores (score) are your original data expressed (or projected) in the new coordinate system of principal components.
"And if i choose some columns of PCA to delete in order to keep the columns with the best variance for the component then i should delete these columns from the scores? OR the columns selection should be done to the original dataset?"
The usual approach to PCA-based dimensionality reduction is to keep your original data as is, run PCA, and then just truncate the columns of the scores (the new coordinate space) to reduce dimension. This does not remove columns from X itself. You only keep the top principal components in score.
If you specifically want to eliminate certain original features, do it before running PCA (that’s feature selection). After that, you run PCA on the remaining features.
Hope this helps!
0 Comments
See Also
Categories
Find more on Dimensionality Reduction and Feature Extraction in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!