Code covered by the BSD License  

Highlights from
PCA

PCA

by

Devinder (view profile)

 

this implements the PCA algorithm. User can choose/input the no.of features in the reduced Dataset.

main.m
%% =============== Program to Implement PCA ===============================

%this program implements pca along with it gives reduced dataset in terms
% of required mo. of features/dimesions
%for any query please contact:
% Devinder Kumar at devinderkumar@ieee.org
% X_reduce: Dataset with reduced dimensions ( here its 100 )
% please Note that here the dataset used i.e. faces.mat is cropped version
% http://itee.uq.edu.au/~conrad/lfwcrop/ of the orginal labeled faces in
% the wild dataset http://vis-www.cs.umass.edu/lfw/

close all; clc; clear;
fprintf('Loading Dataset ....\n')

load ('face.mat');
fprintf('Orignal dimensions/features in dataset for each example\n')
size(x,2)
fprintf('implementing PCA ..\n')

[x_norm, mu, sigma] = featureNormalize(x);

[U,S,X_reduce]= pca(x_norm,10);
fprintf('Now the no. of dimesions/features in each instance of dataset is:\n')
size(X_reduce,2)

Contact us