- A program for feature reduction, principal component analysis ( PCA ) is offered
- The
Main
file illustrates the example of how PCA can reduce the number of features using benchmark data-set - I also demo how to plot the first three components for PCA
feat
: feature vector ( Instances x Features )label
: label vector ( Instances x 1 )
new_feat
: new features ( Instances x Features )
% Benchmark data set
load iris.mat
% Set number of principal compoments
num_pc = 3;
% Principal Component Analysis
new_feat = jpca(feat,num_pc);
% Plot first three principal components
jplot(new_feat,label);
legend({'setosa','versicolor','virginica'});
xlabel('PC 1'); ylabel('PC 2'); zlabel('PC 3');