SVM Playground illustration

SVM Playground

A support vector machine draws the decision boundary that separates two classes with the widest possible margin, keeping only the borderline points — the support vectors — in the final model. Click to add points of either class or load a preset (separable blobs, overlapping blobs, a ring inside a ring), pick a linear, polynomial or RBF kernel and drag the C and gamma sliders; the machine retrains instantly with a simplified SMO solver. The canvas shades both decision regions, marks the margin band where |f(x)| < 1, draws the boundary and rings every support vector, while the readout reports the support vector count and training accuracy. Watch a small C widen the margin and a large RBF gamma wrap the boundary around single points.

Runs 100% in your browser — models are trained and computed locally on your device.

Notes

  • The dual problem maximises Σαᵢ − ½ΣΣαᵢαⱼyᵢyⱼK(xᵢ,xⱼ) subject to 0 ≤ αᵢ ≤ C and Σαᵢyᵢ = 0; only points with αᵢ > 0 — the support vectors — influence the boundary.
  • C trades margin width against violations: a small C tolerates misclassified points and widens the margin, a large C approaches the hard-margin machine.
  • The RBF kernel exp(−γ‖x−x′‖²) has width 1/√γ: a large γ memorises individual points and overfits, a tiny γ approaches a nearly linear boundary.
  • Training uses simplified sequential minimal optimization capped at 200 points and a fixed iteration budget, so the solution is close to, not exactly, the optimum.
  • Runs 100% in your browser — models are trained and computed locally on your device.