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
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.
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‖²)
Centre the hyperplane between both groups first, then rotate.
For non-linear data, try switching kernels before checking.
The margin bar guides you — aim for green!