Feature dimension reduction using PCA

조회 수: 1 (최근 30일)
Atif Shah
Atif Shah 2018년 10월 1일
답변: Image Analyst 2018년 10월 13일
Hello everyone, I am trying to reduce feature dimensions using PCA. The feature matrix is 12614x1536 where 12614 are images and 1536 are features. For PCA I am using the following code:
[coeff, score] = pca(feature_matrix);
new_features = score(:,1:400) * coeff(:,1:400)';
Here, I want to select 400 features but the new_features dimensions are the same as the old features 12614x1536. It should be 12614x400. Please need your feedback, seems I am missing something... Thank you.

답변 (1개)

Image Analyst
Image Analyst 2018년 10월 13일
According to the help, this is the formula:
[coeff1,score1,latent,tsquared,explained,mu1] = pca(y,'algorithm','als');
% Reconstruct the observed data.
t = score1*coeff1' + repmat(mu1,13,1)
And it will just reconstruct the original data, not give you new features.

카테고리

Help CenterFile Exchange에서 Dimensionality 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