Principal Component Analysis
Objective: Project the data onto a lower dimensional space while minimizing the information loss
Principal Component Analysis load mnist m = mean(data); for i=1:size(data_m,2) data_m(:,i) = data(:,i) - m(i); end [pc,evals] = pca_OF(data_m); pc_data = data_m*pc(1:200,:)';
Principal Component Analysis function [pc,evals] = pca_OF(x) [pc,evals] = eig(cov(x)); evals = diag(evals); [evals, si] = sort(-evals); %Sort eigenvalues evals = -evals; pc = pc(:,si)'; %Sort eigenvectors by magnitude of eigenvalues
Sorted Eigenvalues
Normalized Cumulative Variance (information preserved)
Projecting the digits onto the first two PCs
Projecting the digits onto PCs 1 and 3
Projecting the digits onto PCs 2 and 3
Recognition Accuracies and Running Times with MNIST dataset PCs% VarianceRunning timeAccuracy 323.1%29.1 s %55.0 s %98.4 s %172.5 s %282.6 s %587.1 s % s % s0.9720