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

Maximum-margin classifiers

Watch a classifier pick the widest street between two classes, and price points inside.


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.26 · MARGIN BAY3 LINES · WIDEST STREET 2.19
01
Stage 1 of 6 · Many lines
The perceptron finds 3 splitting lines. Their margin widths differ, up to 2.19.
Explain it simply

You see two classes of points: filled dots and open dots. Any of the three gray lines splits them. The perceptron found each one by fixing its mistakes, in a different order. The street around each line reaches its nearest point. The widest is only 2.19.

Twelve points in two classes. Three perceptron lines, A, B and C, split them, with street widths 1.11, 0.57, 2.19.

points (classes: filled +1, open −1)w, α and support vectorsline, street and tubeslack ξ and lossother candidate lines
points and linesx₁x₂ABC123456789101112street width per lineA1.11B0.57C2.19points and linesx₁x₂ABC123456789101112street width per lineA1.11B0.57C2.19
Toy: 12 + 1 points in 2 classes · 10 for regression
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
di=yi (w⋅xi+b)∥w∥,width=2min⁡idi\sy{d}{out}{d_i} = \frac{\sy{y}{data}{y_i}\,(\sy{w}{param}{w}\cdot \sy{x}{data}{x_i} + \sy{b}{param}{b})}{\lVert \sy{w}{param}{w} \rVert},\qquad \sy{width}{out}{\text{width}} = 2\min_i \sy{d}{out}{d_i}
A: 2⋅0.555=1.11,B: 2⋅0.283=0.57,C: 2⋅1.093=2.19A:\ 2\cdot 0.555 = 1.11,\quad B:\ 2\cdot 0.283 = 0.57,\quad C:\ 2\cdot 1.093 = 2.19

A street reaches from the line to its nearest point, on both sides.

Common mix-ups

MYTHEvery training point helps to place the SVM line.

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

Predict, then reveal
3 CHECKS · PRO
Q01Lower C from 1 to 0.1. Does the street get wider or narrower?

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.