Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Driscoll authored Feb 10, 2020
1 parent 4677944 commit 06c2851
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,20 @@ Example
Of course, the data being explored does not have to be chemical in nature... the PPA framework can be applied to any multivariate data set. In this example, we will apply it to a subset of [The AT&T face data set](https://git-disl.github.io/GTDLBench/datasets/att_face_dataset/). This subset consists of 4 classes (people) each with 10 different grayscale images of their face (112 x 92 pixels). All images were vectorized along the row direction (112 x 92 --> 1 x 10304) producing a 40 x 10304 data set X which was then column mean-centered. Let's apply PCA and PPA and plot the first two scores vectors:

```matlab
Xm = X - mean(X);
% PCA of mean centered data via singular value decomposition
[U, S, V] = svds(X, 2);
[U, S, V] = svds(Xm, 2);
T_PCA = U*S;
% PPA of mean centered data using PCA compression to avoid PPA finding spurious low kurtosis values
% PPA of mean centered data using PCA compression (15 components) to avoid PPA finding spurious low kurtosis values
[U, S, V] = svds(Xm, 15);
[T_PPA] = projpursuit(U*S,2)
% Class vector (classes were vertically stacked in groups of 10)
class = [ones(1,10), 2*ones(1,10), 3*ones(1,10), 4*ones(1,10)];
cvec = ['b' 'k' 'r' 'g' 'y' 'c' 'm' 'w'];
% Colour vector for plotting
cvec = ['b' 'k' 'r' 'g'];
% Plot the PCA scores
figure
Expand Down

0 comments on commit 06c2851

Please sign in to comment.