Support Vector Machines

16 min read

A Support Vector Machine, or SVM, splits two groups with a straight line. Many lines can do this job, so it picks the one with the widest empty road between the groups. In this lesson you see why a wide road is safer, and you move a line yourself.

New words

Margin
The width of the empty road between the line and the nearest points.
Support vector
A point that touches the edge of the road. Only these points matter.
Hyperplane
The dividing line in 2D, or a flat sheet in more dimensions.
Soft margin
A road that allows a few points to be on the wrong side.
C
A setting for how much each mistake costs. Big C means few mistakes allowed.
Kernel trick
Lifting points into a new space where a straight cut works.

What you will learn

  1. Which line should separate the groups?
  2. What is the margin?
  3. How far is a point from the line?
  4. How wide is the road for a line?
  5. How does the line classify new points?
  6. What if the groups overlap? Soft margin and C
  7. What if a straight line cannot work? The kernel trick
  8. When should you use an SVM?
  9. Try it: find the widest road
  10. Common mistakes
  11. Explain it to a friend
  12. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap