For example, two classification classes can be obtained by finding the mean value of the
feature with largest
i
.
8. For compression, reduce the dimensionality of the new feature vectors by setting to zero
components with low
i
values. Features in the original data space can be obtained by
c
T
X
=W
T
c
T
Y
.
12.10 Example
Code 12.1 is a Matlab implementation of PCA, illustrating the method by a simple example
with two features in the matrix cx.
In the example code, the covariance matrix is called CovX and it is computed by the Matlab
function cov. The code also computes the covariance by evaluating the two alternative definitions
given by Equations 12.22 and 12.23. Notice that the implementation of these equations divides
the matrix multiplication by m 1 instead of m. In statistics, this is called an unbiased estimator
and it is the estimator used by Matlab in the function