Exercise: PCA in 2D
From Ufldl
(→Step 1a: Implement PCA) |
|||
Line 11: | Line 11: | ||
==== Step 1a: Implement PCA ==== | ==== Step 1a: Implement PCA ==== | ||
- | In this step, you will implement PCA to obtain <math>x_{rot}</math>, the matrix in which the data is "rotated" to the basis comprising the principal components (i.e. the eigenbasis of <math>\Sigma</math>). As mentioned in the implementation notes, you should make use of MATLAB's <tt>svd<tt> function here. | + | In this step, you will implement PCA to obtain <math>x_{rot}</math>, the matrix in which the data is "rotated" to the basis comprising the principal components (i.e. the eigenbasis of <math>\Sigma</math>). As mentioned in the implementation notes, you should make use of MATLAB's <tt>svd</tt> function here. |
Plot the resulting basis on top of the given data points. You may find it useful to use MATLAB's <tt>hold on</tt> and <tt>hold off</tt> functions. | Plot the resulting basis on top of the given data points. You may find it useful to use MATLAB's <tt>hold on</tt> and <tt>hold off</tt> functions. |