Support Vector Machine

SVM chooses a boundary that is not just correct, but safely separated.

Support Vector Machine is a margin-based classifier. It asks: among all possible boundaries, which one leaves the widest safety gap from the closest training points?

The core question

Opening question

If three different lines classify all training points correctly, which line should we trust on future data?

SVM prefers the line with the largest margin. The margin is the safety gap between the decision boundary and the closest examples from each class.

\[ \text{SVM} = \text{maximum-margin classifier} \]

The closest points are called support vectors because they decide where the boundary sits.

decision boundary margin support vectors touch the margin

SVM is geometric: boundary, margin, and support vectors.

Session story

Many linesWidest marginScratch trainingSoft marginKernels + practice

The pages follow the same flow as the notebook: visual intuition first, then formulas, then code-ready practical choices.

Roadmap

Where SVM is useful

Use caseWhy SVM can work well
Text classificationHigh-dimensional sparse features often work well with linear SVM.
Medical classificationStrong margin-based boundaries can work well on small to medium numeric datasets.
BioinformaticsOften many features and fewer samples, where margin-based models can be strong.
Engineered image featuresSVM can classify embeddings or handcrafted visual features.
Nonlinear toy/medium dataRBF and polynomial kernels can create curved boundaries.
Regression with robust toleranceSVR fits a function while ignoring small errors inside an epsilon tube.
Next: Geometry