Skip to content
AI360Xpert
Core ML
Visual explainer

Support Vector Machines

Maximum margin — finding the widest street between two classes.

Why closest point classifiers fail at margins
Why closest point classifiers fail at margins

Many lines can perfectly separate two classes. However, lines that pass too close to the training data are brittle and likely to misclassify new examples.

The Maximum-Margin Hyperplane

The maximum-margin hyperplane: widest street between classes
The maximum-margin hyperplane: widest street between classes

An SVM finds the "widest street" that separates the groups. It positions the boundary exactly in the middle of this maximum margin for maximum safety.

Support Vectors

Support vectors: only the boundary points control the line
Support vectors: only the boundary points control the line

The points sitting directly on the edge of the street are the support vectors. They alone define the boundary; all other data points could be deleted without changing the model.

Soft Margins

Soft margins: slack variables handle overlapping classes
Soft margins: slack variables handle overlapping classes

When classes overlap, a rigid boundary fails. Slack variables allow a few points to violate the margin or even end up on the wrong side, preserving a wider, more generalisable street.

Where It Breaks

The failure: kernel choice is a black-box hyperparameter
The failure: kernel choice is a black-box hyperparameter

For non-linear data, SVMs use the kernel trick. But choosing the right kernel and tuning its hyperparameters (like C and gamma) is difficult and opaque.

The Quick Version

  • Problem: Arbitrary boundaries are brittle on unseen data.
  • Mechanism: Find the widest possible margin between classes.
  • Support Vectors: Only the edge points define the model.
  • Soft Margins: Allow some violations to avoid overfitting.
  • Failure: Kernels can be black boxes that overfit easily.

What to Read Next