/Dimensionality-Reduction-Demonstration

Application of principal component analysis (PCA) for feature reduction.

Primary LanguageMATLABBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

PCA Dimensionality Reduction Demonstration

View Dimensionality Reduction Demonstration on File Exchange License GitHub release

Wheel

Introduction

  • 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

Input

  • feat : feature vector ( Instances x Features )
  • label : label vector ( Instances x 1 )

Output

  • new_feat : new features ( Instances x Features )

Example

% 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');