Classification Overview
Chapter 9 predicted a real number. Chapter 10 found a compact representation. Chapter 11 estimated a density. Chapter 12 predicts one of two labels — the last of the book’s four pillars — and it does so with no probability anywhere in it.
The book gives two reasons for choosing the SVM to carry this chapter. First, “the SVM allows for a geometric way to think about supervised machine learning” — it reasons about inner products and projections rather than likelihoods, which makes it the counterpart of Chapter 10 rather than of Chapter 9. Second, “the optimization problem for SVM does not admit an analytic solution so that we need to resort to a variety of optimization tools introduced in Chapter 7.”
One classifier, four derivations
Section titled “One classifier, four derivations”| §12.2.1 | §12.2.2 | §12.3.1 | §12.3.2 | |
|---|---|---|---|---|
| the question asked | how far is the closest point? | same, with the scale fixed differently | what do the Lagrange multipliers say? | which two points of the two hulls are closest? |
| what is optimised | over | |||
| variables | ||||
| convex | no | yes | yes | yes |
They are not four methods that happen to agree. Measured across random datasets, the first two return hyperplanes whose normals differ by at most degrees. The fourth, converted through a formula the book does not state, matches a primal solve to .
The conversion is worth having, because §12.3.2 leaves it out:
The margin is half the distance between the two convex hulls. That is the shortest true statement of what an SVM computes, and it appears nowhere in the chapter.
The one property everything follows from
Section titled “The one property everything follows from”The hinge loss reaches exactly zero:
An example beyond its margin contributes nothing. Not a small amount — nothing. Four consequences, each measured on a different page:
| consequence | where | measured |
|---|---|---|
| a distant correct point cannot move the fit | 1205 | boundary at with the outlier at , or |
| most multipliers are zero | 1206 | of examples carry the answer |
| deleting the rest changes nothing | 1206 | adding more changes nothing either — of mass |
| the support vector count bounds leave-one-out error | 1210 | of gives a guarantee of |
Contrast the logistic loss, which the book names as the maximum-likelihood counterpart in §12.6: it is at and never zero. Every example keeps a gradient forever, so logistic regression has no support vectors — measured, deleting the SVM’s ignored examples leaves the SVM bit-for-bit identical and moves logistic regression’s offset by .
Where the measuring pays off
Section titled “Where the measuring pays off”Zero training error does not pick a classifier. sampled hyperplanes separate the eight running-example points perfectly, and their held-out accuracy spans . Something has to break the tie, and the margin is what §12.2 proposes.
But the margin raises the floor, not the ceiling. Binned by margin, the worst held-out accuracy climbs from to while the best barely moves. Across datasets the max-margin solution averages the th percentile among separators that fit equally well — and beats all of them on only . It gives up on average against the best that existed. Maximising the margin is insurance, not optimisation, which is what the generalisation bounds the book cites actually prove.
Equation 12.10 is not a convex problem, and the book presents Theorem 12.1 as an equivalence rather than an upgrade. The constraint is a sphere; measured, a local solver fails on of random starts, against for Equation 12.21.
Leaving out of the regulariser is not a technical inconvenience. The book calls it a complication for theory and efficiency. It is what makes the answer independent of where the origin sits: shifting the data by leaves the optimal value unchanged to , while penalising changes it by .
“Infinite-dimensional feature space” has a measurable consequence. A feature map of dimension gives a Gram matrix of rank at most . Polynomial kernels saturate exactly — , , at every from to — and the RBF’s never levels off, climbing from to . That is what having no finite feature map looks like from outside.
The chapter never mentions standardising, and it is worth a quarter of a point of accuracy. Scaling one feature by and refitting is the same as minimising under the original constraints — so the units decide how expensive each feature is to use. On data where the cheap feature is the bad one, held-out accuracy swings by . Standardising first collapses the spread to .
The pages
Section titled “The pages”| # | page | book section | the measured claim |
|---|---|---|---|
| 1201 | Separating Hyperplanes | §12.1 | perfect classifiers, accuracy spanning |
| 1202 | The Concept of the Margin | §12.2.1 | Equation 12.10 is non-convex; of solves fail |
| 1203 | Why the Margin Can Be Set to One | §12.2.2–12.2.3 | Theorem 12.1 to degrees |
| 1204 | The Soft Margin SVM | §12.2.4 | unregularised buys translation invariance, |
| 1205 | The Hinge Loss | §12.2.5 | a distant correct point moves the squared-loss boundary |
| 1206 | The Dual Support Vector Machine | §12.3.1 | , an identity the book omits |
| 1207 | The Convex Hull View | §12.3.2 | the margin is half the distance between the hulls |
| 1208 | Kernels | §12.4 | polynomial Gram rank saturates at , , ; the RBF’s never does |
| 1209 | Numerical Solution | §12.5 | a generic solver is times slower at |
| 1210 | Chapter 12 Worked Problems | §12.6 | eight problems, this module’s own |
| 1211 | Chapter 12 Formula Sheet | — | every equation and every measured constant |
Two small corrections
Section titled “Two small corrections”Neither changes anything that follows, but both are worth knowing about while reading.
Equations 12.5, 12.6 and 12.7 are not quite equivalent. Equation 12.6 is strict and 12.7 is not, so a point sitting exactly on the hyperplane satisfies 12.7 and violates 12.6. The disagreement is confined to a set of measure zero — and page 1204 found a case where it matters numerically, with an optimal boundary running exactly through two training points whose labels are then decided by a quantity of size .
§12.3.1’s margin note runs only one way. It says examples on the margin are those with . The KKT conditions give that implication, not its converse: permits too, and at on the running example three on-margin examples sit exactly at the bound. The optimum there is unique, so it is not a solver artefact.
There is also a third, smaller one: §12.3.1’s fallback rule for recovering takes a median of absolute differences, which discards the sign and returns where the answer is .
What the chapter assumes, and what it costs
Section titled “What the chapter assumes, and what it costs”§12.6 is a page of pointers. Page 1210 runs the ones that can be run:
| what the chapter says or omits | measured |
|---|---|
| “a classifier with large margin turns out to generalize well” | true as a percentile — — and false as an optimum |
| is introduced and never chosen | its good plateau is four orders of magnitude wide |
| kernel parameters “chosen using nested cross-validation” | and do not tune independently: runs across |
| “does not naturally lend itself to a probabilistic interpretation” | of its scores fall outside |
| Platt scaling as the repair | costs accuracy in the probabilities: Brier against logistic regression’s |
| (never mentioned) feature scaling | worth of held-out accuracy |
| (never mentioned) class balance | at positives against negatives, recall on the minority is exactly |
Where it goes next
Section titled “Where it goes next”| §12.6’s pointer | and where it already appeared |
|---|---|
| logistic regression — the maximum-likelihood counterpart | page 1205’s loss table; page 1210’s measurement that it has no support vectors |
| Platt scaling and class probability estimation | page 1210, measured against a known true posterior |
| kernel methods more broadly | page 1208, and Chapter 10’s §10.5 where the same matrix appeared |
| the Legendre–Fenchel transform as another route to the dual | Chapter 7’s §7.3.3 |
| empirical risk minimisation and the theory behind the margin | Chapter 8’s §8.2 |
| Gaussian process classification — a latent function prior | Chapter 9’s §9.3, and Chapter 11’s latent variables |
And that closes the four pillars: regression in Chapter 9, dimensionality reduction in Chapter 10, density estimation in Chapter 11, classification here.
Recall card
Section titled “Recall card”- Chapter 12 is the last of the four pillars, classification, and it reasons geometrically rather than probabilistically.
- It prints no numbers at all — no worked examples anywhere — so every value in this module is its own, checked against an eight-point running example whose answer is exact.
- One classifier is reached four ways, and they agree to seven millionths of a degree across three hundred random datasets.
- Only one of those four formulations is convex. The unit-sphere constraint of Equation 12.10 makes a local solver fail on one start in eight, while the squared-norm form never fails.
- Zero training error does not pick a classifier, and the margin is what breaks the tie.
- But the margin raises the floor rather than the ceiling. It lands at the 84th percentile every time and is almost never the best separator available.
- The hinge loss reaches exactly zero, and everything distinctive about the method follows: distant points cannot move the fit, most multipliers are zero, deleting them changes nothing, and the support vector count bounds the leave-one-out error.
- The logistic loss never reaches zero, which is why logistic regression has no support vectors and every example influences it forever.
- The dual’s size depends on the number of examples and never on the number of features, which is the only reason an infinite-dimensional feature map is usable.
- An infinite-dimensional feature space is measurable as a Gram rank that never saturates — polynomial kernels stop at 6, 10 and 21, and the RBF keeps climbing.
- Read geometrically, the whole method is: find the two closest points of the two convex hulls and bisect the segment, and the margin is half its length.
- Leaving the intercept out of the regulariser is what makes the answer independent of the coordinate system, which the book mentions only as a complication.
- The chapter never mentions standardising, and a change of units on one feature is worth a quarter of a point of held-out accuracy.
Start here: Separating Hyperplanes
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading