Log inStart free
LESSON 4.27 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

The kernel trick

Watch points lift into a new space, where a flat plane splits them.


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

Go Pro · $8.25/mo
EXPLAINER · 4.27 · KERNEL BAYLINE · 7 OF 16 WRONG
01
Stage 1 of 6 · A line fails
A linear SVM fits a straight line. It still gets 7 of 16 points wrong.
Explain it simply

You see 16 points: filled ones are class plus one, hollow ones are class minus one. One class sits in the middle, and the other class sits in a ring around it. The SVM's straight line still gets 7 points wrong, in red. No straight line can split these classes.

Sixteen points in two classes. The linear SVM's straight line gets 7 of them wrong.

point: filled +1, hollow −1α and support vectorboundary, +1 sidewrong pointframe
input xfeature space φ(x)kernel matrix Kx₁x₂−2−2220.6x₁ − 0.9x₂ + 0.41 = 0αinput xfeature space φ(x)kernel matrix Kx₁x₂−2−2220.6x₁ − 0.9x₂ + 0.41 = 0α
Toy: 16 points in 2-D, 8 per class · soft-margin SVM, C = 10 · poly (x·z)² · RBF wide γ = 1, narrow γ = 50
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
w⋅x+b=0\sy{w}{param}{w}\cdot \sy{x}{data}{x} + \sy{b}{param}{b} = 0
0.6 x1−0.9 x2+0.41=00.6\,x_1 - 0.9\,x_2 + 0.41 = 0

Points on one side of the line get +1; the rest get −1.

Common mix-ups

MYTHThe kernel trick builds the lifted points, then trains on them.

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

Predict, then reveal
3 CHECKS · PRO
Q01On the XOR data, can a straight line get every point right?

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 2 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.