Skip to content

JingweiToo/Dimensionality-Reduction-Demonstration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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