Classical ML

Principal Component Analysis, visualized

Principal Component Analysis finds the directions along which your data varies the most, then describes the data using just those. It's the workhorse of dimensionality reduction — turning many correlated features into a few informative ones with almost no loss.

Here you rotate a candidate axis through a tilted cloud of points and drop each point's shadow onto it. The spread (variance) of those shadows is largest exactly along the first principal component — the top eigenvector of the covariance matrix. 'Snap to PC1' jumps straight to it.

Rotate the axis to catch the most spread

Variance along axis

1.61

max possible is 2.09 (at PC1). The best axis keeps the most information.

Free · runs entirely in your browser · nothing to install

How to use it

  1. Rotate the axis and watch every point drop a perpendicular shadow onto it.
  2. Read the variance of those shadows — the wider the spread, the more information kept.
  3. Press 'Snap to PC1' to jump to the best axis, the direction PCA would keep.

What you'll take away

  • Why PCA is 'the direction of maximum variance'.
  • How projecting onto fewer axes compresses data.
  • The link between principal components and eigenvectors of the covariance matrix.

Want to actually build this?

This demo is one moment inside a full Math to Machine lesson — predict, build, and explain the concept, with an AI tutor that gives hints, not answers. The first five lessons are free.

FAQ

What does PCA actually do?
PCA rotates the data onto new axes ordered by how much variance they capture, then keeps only the top few. Those axes are the eigenvectors of the covariance matrix, and the kept coordinates hold most of the original information.
When should you use PCA?
Use it to reduce many correlated features to a handful for visualization, faster training, or noise removal — whenever the data really lives in fewer effective dimensions than its number of columns suggests.

More Classical ML tools