What does principal component analysis (PCA) do to a dataset, what are principal components geometrically, and why do we often keep only the first few?

Unsupervised learning, Principal component analysis
Level L1 Beginner. Length Short. Nature Th Theoretical.

What's being asked

Whether you have the geometric intuition for PCA before learning about feature scaling, covariance matrices or singular value decomposition (SVD).

Key idea

PCA rotates the coordinate axes of centred data so that the first new axis (PC1, first principal component) points along the direction of widest spread (largest variance), the second axis (PC2) is perpendicular to PC1 along the next widest spread, and so on. Keeping only the top k axes compresses the data while losing as little information as possible.

Steps

  1. Use a camera analogy: imagine taking a 2-D (two-dimensional) photograph of a 3-D (three-dimensional) flat pancake. If you shoot from directly above, looking along the thin direction, the photo keeps almost all the shape and drops only the thickness.
  2. Describe how PCA builds the new axes: first centre the cloud of points around zero, then pick PC1 along the direction where points vary most, PC2 at 90∘ to PC1 along the next largest variation, and continue up to the number of original features.
  3. Explain why we keep only the top k components: later components capture tiny variations (often just measurement noise), so dropping them shrinks storage, speeds up downstream models, and lets us plot high-dimensional data in 2-D or 3-D.
  4. Note the main trade-off: each principal component is a blend of all original features, so you gain compactness at the cost of easy feature-by-feature interpretability.

Common mistakes

How long your answer should be

About 2 minutes: camera analogy, perpendicular variance-ordered axes, and why we drop the tail.

Read this

Previous in Unsupervised learning: How does the k-means clustering algorithm group unlabelled data points into k clusters, and what happens in one full iteration on the 1-D (one-dimensional) points {0,2,8,10} with k=2 starting from initial centres 2 and 6?
Next in Unsupervised learning: Why should you usually standardise features before running principal component analysis (PCA)?