MPE StudioMath of Planet Earth
Machine Learning Toolkit · 10

PCA and Linear Regression

Two notions of the best line for denoising

PCA and linear regression can both replace a noisy cloud with a line, but they optimize different distances and answer different questions.

watchone idea
→
manipulateone example
→
leave withone intuition

The essential idea: regression minimizes vertical error; PCA minimizes orthogonal reconstruction error.

Watch the concept

One Concept · One Example

PCA and Linear Regression video thumbnail▶

PCA and Linear Regression

Presented by Charlotte Moser

Watch on YouTube ↗

What to notice

The idea in 30 seconds

The distance defines the answer

Regression line

Vertical residuals are appropriate when x is treated as known and y is predicted.

minθ∑in(yi−y^i)2

PCA line

Orthogonal residuals are appropriate when all coordinates are noisy measurements.

minv∑in‖xi−x^i‖2
Explore

Compare the two best lines

Increase noise in both coordinates. See when the regression and PCA directions visibly separate.

KEY TAKEAWAY

Choose regression for directional prediction and PCA for symmetric geometric denoising.