Skip to content
BENIBIX Learn

Principal Component Analysis (PCA)

AI📈 Machine LearningClassic ML Algorithms

Also known as PCA, Principal Components

Squeezes many columns into a few new ones. It keeps as much of the spread as it can.

Think of it like

It is like finding the best angle to take a photo of a crowd. You see the most from one side.

Example

Lucy has 50 survey answers per person. PCA turns them into 2 new columns. On a chart, the people now fall into three clear groups.

Why it matters

Fewer columns train faster and are easier to see. Most of the useful pattern stays.

Definition

Principal component analysis squeezes many columns into a few new ones. It looks for the direction in which the data spreads out most. That direction becomes the first new column. The second new column is the next biggest spread, at a right angle to the first. Keeping just a few keeps most of the story. It is used to draw data on a flat chart and to speed up other models.
PCA is one way to make this squeeze: 50 columns down to the 2 that spread most.

Common mistake

Running it on columns with very different ranges. Scale them first, or the biggest numbers win.

Key takeaways

  1. 1
    Find the spread. The direction where data varies most.
  2. 2
    Keep a few. Drop the directions that add little.
  3. 3
    Scale first. Big numbers would take over.

Learn it properly