This sandbox was generated by Claude (Anthropic) for the ML 101 course materials. It
trains a real soft-margin support vector machine on a small 2D dataset with an actual dual
solver — a simplified SMO — and shows the four things the Module 4 lesson
describes in words: the decision boundary, the two margin lines at a functional
margin of ±1, the support vectors that alone determine the fit, and the
maximum margin the SVM is built to find. Nothing here is sketched — the boundary and
the margins are drawn by evaluating the solved decision function f(x) over a grid.
C is the softness dial, and the page shows exactly what it buys. Small C tolerates violations to keep the margin wide; large C insists every point sit outside its margin, so the margin narrows and the boundary bends toward the awkward points. The margin width is 2/‖w‖ and it is computed from the solved w, so you can watch it grow as you lower C. Switch the kernel to RBF and a boundary a straight line could never draw — the circle, the XOR — snaps into place, at the cost of a gamma you can over-tune into overfitting.
SMO is iterative, and this page is honest about it. It runs to a fixed KKT tolerance with a generous pass budget and reports the iteration count and whether it converged. On a small linearly separable set it reaches the analytic maximum-margin answer; where a solve does not settle, the page says so rather than printing an unconverged margin as if it were exact.
Computed: every dataset (seeded and reproducible), the trained dual variables, w and
b for the linear kernel, ‖w‖ and the margin 2/‖w‖, the support-vector
set, the hinge loss and the number of margin violations, the train accuracy, the C-sweep of margin
width and support-vector count, and the boundary by evaluating f() on a grid.
Published figures: none — everything is a definition or a direct computation.
Chosen rather than computed: the four dataset shapes, the class separation, the label-noise
level, the point count, the seed, and the default C, kernel and gamma.
Course demo — linked from the Module 4 lesson deck; the page itself is English‑only for now. A support vector machine draws the boundary that sits as far as possible from the nearest points of each class. This page lets you set the softness C, the kernel and gamma, and then trains a real SVM and solves for that boundary from the data. One thing to take away: only the support vectors matter — move any point that is not one and the boundary does not budge, which is exactly why the SVM is defined by its margin.