Principal component analysis
PCA constructs orthogonal directions of large variance without class labels. Centre the data before forming its covariance matrix. Decide whether to scale features: covariance PCA and correlation PCA solve different problems.
11.1 Covariance, principal directions and scores
Past papers · DA 2024–2026 (3 papers): 2 questions, 3 marks
Let have observations in rows and features. Write for the training mean and . Choose divisor for mean-square covariance or for sample covariance.
The directions are orthonormal, so two distinct selected directions have a angle. Scores are uncorrelated under the same covariance convention, but need not be statistically independent. A direction's sign is arbitrary. Repeated eigenvalues make individual directions in that eigenspace nonunique; an orthonormal basis can still be chosen. Changing to rescales eigenvalues, not directions or explained-variance ratios.
11.2 Reconstruction, explained variance and SVD
Use the centred data, eigenvalues and orthonormal directions from Section 11.1. Retaining components gives the best rank-at-most- approximation to centred data under squared Frobenius error.
Orthogonal projection onto the first principal direction; dashed segments show reconstruction residuals.
Last-minute recall
- PCA uses centred inputs and does not use labels.
- Specify the covariance divisor before interpreting an eigenvalue numerically.
- Principal directions are orthogonal; scores are uncorrelated.
- The first component maximises variance under a unit-norm constraint.
- Explained variance is an eigenvalue sum divided by total variance.
- Reconstruction error is the discarded variance with the matching divisor.
- Whitening divides only positive-variance scores by their standard deviations.