Dimensionality reductionSample

Principal component analysis

Finds the directions along which data varies most, so it can be described with fewer dimensions.

Synthetic data, generated and trained in your browser.

Try this

  1. 01Rotate the axis and watch "your axis keeps" peak when it lines up with PC1.
  2. 02Press Snap to PC1, then look at the 1D strip: the spread is as wide as it can be.
  3. 03On Round data, every direction keeps about half: PCA has nothing to compress.

How it works

  1. 1Centre the data on its mean.
  2. 2Find the direction of greatest variance: the first principal component.
  3. 3The next component is perpendicular and captures the most remaining variance.
  4. 4Project onto the first few components to reduce dimensions while keeping most of the information.

What the controls teach

Axis angle (°)
A candidate axis to project onto. Rotate it to find the direction that keeps the most variance.
Projections
Draws each point’s projection onto your axis: the information that is kept.

Use it when

  • Compressing correlated features
  • Visualising high-dimensional data

Avoid it when

  • Non-linear structure
  • Features on different scales without standardising them first