Dimensionality reduction replaces a high-dimensional representation with a lower-dimensional one when the data lies near a line, plane, or other lower-dimensional subspace. The approximation discards small deviations from that subspace, yielding a more compact representation that can expose broad patterns, lower storage costs, and often suppress noise. section 4.1 section 5.7.2
PCA performs this reduction for data concentrated near a line or hyperplane. Its principal axes are ordered by variance: retain axes with large principal values and drop axes with small ones. Projecting points onto the retained axes preserves the main spread while losing the small orthogonal variations. section 4.4.2 section 4.7
Figure 14.3 The original 3D data in figure 14.3a shows high correlation: points are clustered around the X0 = X2 plane. The first principal component corresponds to the direction of maximum variance. The last (third) principal reduced to a 2D latent vector.
|
(a) Original 3D data |
|
(b) Lower-dimensional 2D representation obtained by setting the third principal value to zero |
|
(c) The principal vectors of the original data. The third principal vector is normal to X0 = X2 plane; the other two are in-plane. |
The 3D-to-2D picture makes the criterion visible: a small third principal value identifies the direction normal to the data plane as expendable. section 14.4
A PCA reduction can be carried out as follows:
- Arrange instances as rows of a data matrix and subtract the mean vector to center the data. section 14.4
- Compute an SVD of the centered matrix; its right singular vectors provide the principal directions. section 4.7
- Keep the vectors for the desired large principal values and multiply the data by them to obtain lower-dimensional coordinates. section 14.4.1
- Optionally pad the reduced coordinates with zeros, multiply back by the SVD factor, and restore the mean to reconstruct an approximation. section 14.4.1
Correlated document terms
If document features for “gun” and “violence” have similar values, their points cluster near the line x = y. Replacing the two correlated axes with that single direction simplifies the representation and can reveal a gun-violence topic. section 4.1
PyTorch projection and reconstruction
For 1,000 three-dimensional points near the X0 = X2 plane, center X, run torch.linalg.svd, retain the first two columns of V, and compute X_proj = X @ V_trimmed. Reconstructing after restoring the omitted coordinate is approximate because reduction has discarded information. section 14.4.1
Dimensionality reduction also frames learned latent representations. An autoencoder maps an observed input to a usually smaller latent vector, then is trained to reconstruct the input; the dimension limit forces retention of features useful to the goal and omission of others. A neural-network linear layer with a zero-determinant weight matrix likewise effectively reduces dimensionality. section 14.0 section 12.3













