Principal Component Analysis
Principal component analysis (PCA) is dimensionality reduction done optimally. It
finds the directions of greatest variance in the data — the
principal components — and keeps only the strongest few. The first principal
component is the single line along which the data is most spread out; the second is the
best direction perpendicular to it, and so on.
Here is the payoff of the whole journey. Those principal directions are exactly the
eigenvectors
of the data's covariance matrix — which, being
symmetric,
is guaranteed to hand us perpendicular axes. The eigenvalue of each is how much variance that
direction carries.
Find the principal direction
Rotate the candidate axis and watch the variance of the projected points. It peaks when the axis
lines up with the long stretch of the cloud — that maximum-variance direction is the first
principal component, PC_1. The perpendicular one is
PC_2. Keeping only PC_1 compresses the data
to one dimension while preserving the most information possible.
Why this is the perfect ending
PCA ties the whole Primer together. It needs
dot products
to project, a
symmetric matrix
to summarise the spread, and its
eigenvectors
to find the best axes — every idea earning its keep at once. It powers data visualisation, noise
reduction, face recognition and compression. From an arrow on a page to the principal components
of real data, it's been one connected story: linear algebra is the language, and machine learning
is what it lets you say.