Summarize features, not objects
The topic Mixtures and the EM algorithm explained every object by one hidden discrete variable: the component it came from. Clusters summarize objects, the rows of . This topic summarizes the columns instead: it replaces the features by a few new ones.
Take the digits of scikit-learn: images of pixels, so each object is a vector . The images do not fill . They vary along far fewer directions: which digit it is, its slant, its width, the thickness of the stroke. The points lie near a thin region of low dimension. Describing each object by its position in that region helps in four ways:
- looking: a scatter plot has two axes, and 64 features do not fit on it;
- compression: numbers per object instead of , and everything downstream gets faster;
- denoising: if the signal lives in a few directions and the noise in all of them, dropping the weak directions removes mostly noise;
- distances: the topic Nearest neighbours showed that distances concentrate in high dimension; in a well-chosen low-dimensional space they say more.
The linear tool is already known from Mathematics for ML. The topic Symmetric matrices and quadratic forms found the direction of largest variance as the top eigenvector of the covariance. The topic The singular value decomposition got all such directions from the data matrix itself. Together this is principal component analysis, PCA. Here we use it as a learning method: why it is also the best reconstruction, how many components to keep, what units and whitening do, which probability model stands behind it, its kernel version, and the nonlinear maps used for looking.
Notation. The data are centred, , and has rows . The covariance is , with eigenvalues and orthonormal eigenvectors ; in this topic is an eigenvalue, not a regularization strength. The letter is the number of components kept. has orthonormal columns, , and are the new coordinates of object .