Implementing PCA/Whitening
From Ufldl
Line 19: | Line 19: | ||
Finally, you can compute <math>\textstyle x_{\rm rot}</math> and <math>\textstyle \tilde{x}</math> as follows: | Finally, you can compute <math>\textstyle x_{\rm rot}</math> and <math>\textstyle \tilde{x}</math> as follows: | ||
- | + | xRot = U(:,1:k)' * x; % k is number of eigenvectors to keep | |
- | + | xTilde = U(:,1:k)' * x; % which corresponds to the # dimensions after reduction | |
% set k = size(x, 1) to keep all the eigenvectors | % set k = size(x, 1) to keep all the eigenvectors | ||