Vismo · Create · Explore · Topics · Guides · Pricing

Maximizing the Margin in SVM Classifiers

This animation places two clusters of points on a plane and tests several lines that separate them, settling on the one that maximizes distance to the nearest points on each side. It marks the support vectors and support lines, then defines functional and geometric margins, showing that rescaling w and b leaves the geometric margin unchanged. It finishes by converting margin maximization into the standard quadratic optimization form used in hard-margin SVM, useful for first-year AI students learning classifier theory.

Narrated · 16:9 · Preview before teaching · automatic layout checks do not establish subject accuracy

The prompt that made it

# Support vector machines maximize a geometric margin Place negative samples at (-1,-1), (-1,1), and (-2,0), and positive samples at (1,-1), (1,1), and (2,0). Compare several separating lines, then settle on x1 = 0 with w = (1,0) and b = 0. The support lines are x1 = -1 and x1 = 1, giving a total margin of 2. Highlight the four samples on those lines. Define functional margin y(w^T x+b) and geometric margin y(w^T x+b)/||w||. Scale w and b together to show that the boundary and geometric distances do not change, even though functional scores do. Normalize the minimum functional margin to one and transform maximum margin into minimizing one half of ||w|| squared subject to the classification constraints. Use black backgrounds, cyan and orange points, and perpendicular distance markers. Useful for understanding why normalization matters in hard-margin SVMs. Audience: 一年级人工智能专业学生

Make your own version

Make the next one in this series