Is this the right way to project a training set into eigespace? MATLAB

I calculated the PCA using the following:

function [signals,V] = pca2(data) [M,N] = size(data); data = reshape(data, M*N,1); % subtract off the mean for each dimension mn = mean(data,2); data = bsxfun(@minus, data, mean(data,1)); % construct the matrix YY = data'*data / (M*N-1); [VD] = eigs(Y, 10); % reduce to 10 dimension % project the original data signals = data * V; 

My question is:

Are β€œsignals” a projection of the training set into your own space?

In the Amir Hossein code, I saw that the "centered image vectors", which are the "data" in the above code, should be projected into the "boundary space" by multiplying at the base of their own space. I really don't understand why projection is done using centered image vectors? Are "signals" not enough for classification?

+1
source share
1 answer

From the signals, I assume that you want to ask why we subtract the average from the raw vector image.

If you are thinking about PCA; he is trying to give you a better direction where the data is most different. However, since your images contain a pixel, probably only positive values, these pixels will always be positive, which will be misleading, especially your first and most important eigenvector. You can search more about the second moment matrix. But I will talk about this bad picture. Sorry for my drawing.

Please ignore the size of the stars;

Stars: Your details

Red line: eigenvectors;

As you can easily see in 2D, data centering can provide the best direction for your main component. If you skip this step, your first eigenvector will be biased on average and will lead to lower results.

enter image description here

+1
source

All Articles