Episode 01 · Support Vector Machines

Learn ML by
playing it.

You are a field botanist sorting two species of specimens scattered across a meadow. Your tool? A hyperplane — the razor-sharp decision boundary at the heart of Support Vector Machines, one of the most elegant algorithms in all of machine learning.

🌿 5 Levels 📏 Maximize the Margin 🌀 3 Kernel Types 🧠 Real ML Theory
Hyperplane ← Margin →
The Science

What is a Support Vector Machine?

An SVM finds the optimal hyperplane that separates two classes with the widest possible gap — called the margin.

Key Concepts

Hyperplane — the decision boundary: w·x + b = 0

Support Vectors — nearest points, they define the boundary

Margin — gap = 2 / ‖w‖ — SVM maximises this

Objective — minimise ‖w‖ subject to correct classification

Watch the diagram → dots appear, then the optimal hyperplane draws itself, and the support vectors glow.

Hyperplane ← margin → support vector
Advanced Concept

When a straight line isn't enough

Some data is non-linearly separable — no straight line can divide the classes. The kernel trick solves this by mapping data into a higher-dimensional feature space where a linear hyperplane can separate them.

Three Kernels You'll Use

📏 Linear — straight line, works for simple data

🌀 RBF — circular boundary, great for ring clusters
K(x,y) = exp(−γ‖x−y‖²)

〰️ Polynomial — curved boundary, d=2 gives parabola
K(x,y) = (xᵀy + c)ᵈ

The "trick": computing K(x,y) is cheap, but it's equivalent to working in an infinite-dimensional space.

Original Space Kernel transform Feature Space
Your Mission

Ready to step into the field?

Five levels, three kernel types, and a whole field journal of ML theory waiting. Here's how to play:

🖱️

Drag to Position

Click and drag the hyperplane boundary to place it between the two specimen groups on the canvas.

🔄

Rotate to Align

Use the rotation slider or scroll wheel to find the ideal angle. On mobile, pinch with two fingers.

📏

Maximise Margin

The wider the gap between the boundary and the nearest points, the higher your score. Watch the margin bar!

🌀

Switch Kernels

When data can't be split linearly, switch to RBF or Polynomial kernels. The sidebar tells you when and why.

Press or click Enter the Field to begin. Good luck, Botanist!