See, with pictures and motion, two kinds of points (the houses of two villages) being separated by a line that moves as it learns, or by the widest possible road.
Draw a boundary that separates points described by two descriptors into two classes, using the data. In ① you train logistic regression by gradient descent and watch the cross-entropy loss decrease; you also see the weights keep growing when the data are linearly separable and regularization is removed. In ② you change the kernel, C, and γ and see how the SVM boundary, margin, and support vectors change. In both, check whether you can explain the results by putting the numbers on the screen into the formulas of the text.
The houses of two villages stand on a map. Each time you press ▶, the border line moves a little, and the background color (which village a place seems to belong to) changes too.
These are synthetic data for teaching purposes (the positions of the houses and which village they belong to are made up; this is not a real map).
We build a road between the two villages, touching the houses as little as possible. When we look for the way that makes the road widest, the road turns out to be decided only by the few houses touching its edges.
These are synthetic data for teaching purposes (the positions of the houses and which village they belong to are made up; this is not a real map).
Shading of the posterior probability p(y=1 | x) = σ(a) and the decision boundary (p = 0.5)
The labels are y ∈ {0, 1}. Move the pointer over the figure to see a and p at that point substituted into the formulas below. Click the figure to add a point of the selected class.
Loss L (cross-entropy plus regularization term) versus iteration. The vertical axis is logarithmic. The dashed line is the minimum L* found by Newton’s method (when it exists).
Weight norm ‖w‖ (excluding b) versus iteration. It keeps growing when the data are linearly separable and λ = 0.
SVM score f(x) shading, boundary f = 0, margins f = ±1, and support vectors
The labels are y ∈ {−1, +1} (the convention of Chapter 11). f(x) is a score, not a probability. Move the pointer over the figure to see f(x) at that point substituted into the formulas below. Click the figure to add a point.
Bars of the dual variables αn in decreasing order. The dashed line is the upper limit C. Filled bars (○) have 0 < αn < C; hatched bars (◇) are points with αn = C (the markers are omitted when the bars are thin).
Violation of the KKT conditions m(α) − M(α) versus SMO iteration (both axes logarithmic). The run stops when it falls below the tolerance ε (dashed line).
f(x) is a score, not a probability (it does not stay within 0–1, and its size changes with C and the kernel).
The description of this simulator (procedure, formulas, conditions, questions) is on the explanation page “Explanation of the Classification and Kernels Simulator”.
Back to Machine Learning — From Probability to GPT (Contents) | Text: Chapter 9, Section 9.3, Chapter 10, Section 10.5, Chapter 11, Section 11.5 | Equations and explanation (explanation page) | Equations are typeset with the browser’s built-in MathML (no external library).