Log inStart free
LESSON 4.34 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

PCA

Watch PCA turn the axes to where the Swiss roll spreads most.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 4.34 · PCA BAYMEAN (0.08, 10.95, 0.05) → 0
01
Stage 1 of 6 · Center the data
PCA first subtracts the mean μ = (0.08, 10.95, 0.05) from each point.
Explain it simply

Each mark is one point on the sheet, with three features: x, the height h, and z. The cross is their mean, the average point. Every point slides by the same amount, so the mean lands on 0. On the right, each feature now has a mean of 0.

The 120 points of the flat sheet in 3-D, in four clusters A to D. Their mean (0.08, 10.95, 0.05) moves to 0, and every point moves with it. Three strips show x, h and z, each with its mean now at 0.

points, their mean, C and Kdirections u, PC1–PC3 and eigenvalues λscores: feet on u, the mapgaps: the variance a direction losesmatrix cells and axes
120 points in 3-D, shifted so the mean is 0flat sheet in 3-D · drag to turnxhzμ → 0x−20−1001020mean 0.08 → 0h−20−1001020mean 10.95 → 0z−20−1001020mean 0.05 → 0120 points in 3-D, shifted so the mean is 0flat sheet in 3-D · drag to turnxhzμ → 0x−20−1001020mean 0.08 → 0h−20−1001020mean 10.95 → 0z−20−1001020mean 0.05 → 0
Toy: the 4.C4 Swiss roll · 120 points · 3 features · keep 2 of 3 · stage 6: 16 points on two rings
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
x~i=xi−μ,μ=1n∑i=1nxi\sy{xt}{data}{\tilde x_i} = \sy{x}{data}{x_i} - \sy{mu}{data}{\mu},\quad \sy{mu}{data}{\mu} = \frac{1}{n}\sum_{i=1}^{n} \sy{x}{data}{x_i}
μ=(0.08,10.95,0.05)x~A1=(−22.03−0.08,5.24−10.95,−12.72−0.05)=(−22.11,−5.71,−12.77)\begin{gathered} \mu = (0.08, 10.95, 0.05) \\ \tilde x_{\text{A1}} = (-22.03 - 0.08, 5.24 - 10.95, -12.72 - 0.05) \\ = (-22.11, -5.71, -12.77) \end{gathered}

Each point moves by minus the mean, so the new mean is 0.

Common mix-ups

MYTHPC1 is the least-squares line through the points.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01On the flat sheet, near which angle does u keep the most variance?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.