principal component analysis for dimensionality reduction

10 views (last 30 days)
My dataset has 22 features with large no.of samples. I want to reduce it to 10 features by using principal component analysis. The features want to be optimal. Matlab has function for this. But I didn't get clear picture of how to use it. Please somebody help.

Answers (1)

Image Analyst
Image Analyst on 1 Feb 2020
Edited: Image Analyst on 1 Feb 2020
You can use pca() if you have the Statistics and Machine Learning Toolbox. Did you try it? Basically you put your data in as a matrix with each of the 22 variables being a column, and your observations/measurements being the rows. For example row 9 has all the 22 measurements for sample/observation/test set #9, and so on. Then you'll get 22 PCs where each row of output has the PC weights for those 22 PCs. There are fancy ways, like Eigenvector's PLS toolbox where you can examine the data to try to figure out which of those 22 PC are the most relevant (strongest).
I've attached a PCA example where I used PCA to find the PCs of a collection of separate values (x, y, and z locations):
00_Screenshot.png
along with another, different example where I take the PCs of an RGB image:
01_Screenshot.png

Categories

Find more on Dimensionality Reduction and Feature Extraction in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!