Skip to content
BIASED

Dimensionality reduction

Block 1 of 8~2 min

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 XX. This topic summarizes the columns instead: it replaces the dd features by a few new ones.

Take the digits of scikit-learn: 17971797 images of 8×88 \times 8 pixels, so each object is a vector x∈R64x \in \mathbb R^{64}. The images do not fill R64\mathbb R^{64}. 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: kk numbers per object instead of dd, 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, ∑ixi=0\sum_i x_i = 0, and X∈Rn×dX \in \mathbb R^{n \times d} has rows xi⊤x_i^\top. The covariance is S=1nX⊤XS = \frac1n X^\top X, with eigenvalues λ1≥⋯≥λd≥0\lambda_1 \ge \dots \ge \lambda_d \ge 0 and orthonormal eigenvectors v1,…,vdv_1, \dots, v_d; in this topic λ\lambda is an eigenvalue, not a regularization strength. The letter k<dk < d is the number of components kept. W∈Rd×kW \in \mathbb R^{d \times k} has orthonormal columns, W⊤W=IkW^\top W = I_k, and zi=W⊤xi∈Rkz_i = W^\top x_i \in \mathbb R^k are the new coordinates of object ii.

Answers are saved on the server and tied to this browser until you sign in.