§5.6.1 Maximum a posteriori (MAP) estimation
Full Bayesian posteriors are principled but usually intractable. The compromise keeping some of the prior’s benefit: MAP estimation map estimation Maximum a posteriori point estimate: arg max log p(x|θ) + log p(θ) — keeps the prior's pull; Gaussian prior ⇒ weight decay. defined in ch. 5 — open in glossary — a point estimate at the posterior’s peak:
Term by term
| the familiar log-likelihood — the data’s vote | ML term | |
| the prior’s vote: with a Gaussian prior N(0, (1/λ)I²) this term IS the weight-decay penalty λwᵀw (plus a w-free constant) — MAP with a Gaussian prior ≡ weight decay | prior term | |
| the prior information reduces the estimate’s VARIANCE relative to plain ML — at the price of added BIAS (§5.4.4’s trade, enacted) | bias↔variance |
Aside — which regularizers are MAP?
Many regularized estimations are MAP in disguise: any extra objective term corresponding to qualifies, and the view is generative — e.g. a mixture-of-Gaussians prior yields complicated yet interpretable penalties. But NOT all: some regularizer terms are not the log of any distribution, and others depend on the data — which a prior, by definition, cannot.
§5.7.1 Probabilistic supervised learning
Most supervised learning in this book = estimate by maximum likelihood. Linear regression was the family . For two classes, the mean of a binary variable must live in (0, 1) — so squash the linear score with §3.10’s sigmoid: logistic regression logistic regression Classification via p(y=1|x) = σ(θᵀx): squash a linear score into (0,1); no closed form — gradient descent on the NLL. defined in ch. 5 — open in glossary , (a classification algorithm, despite the name):
Unlike linear regression there is no closed form for the optimal weights — one searches, minimizing the negative log-likelihood by gradient descent. The same recipe — write a parametric family of conditionals, maximize likelihood — extends to essentially any supervised problem.
§5.7.2 Support vector machines
The SVM support vector machine Linear score wᵀx + b, class-only output; famous for the kernel trick; predictions need only the support vectors (nonzero αᵢ). defined in ch. 5 — open in glossary is also driven by a linear score — but outputs only a class identity (positive score → positive class), no probabilities. Its great gift to ML is the kernel trick kernel trick Rewrite an algorithm in dot products, then substitute k(x, x⁽ⁱ⁾) = φ(x)·φ(x⁽ⁱ⁾): nonlinear in x, still convex, sometimes infinite-dimensional φ with cheap k (Gaussian/RBF = template matching). defined in ch. 5 — open in glossary :
Term by term
| dual coefficients: the model rewritten EXCLUSIVELY in dot products between examples | m×1 | |
| swap every dot product for a KERNEL: a dot product in a feature space φ you never construct | the trick | |
| nonlinear in x, yet LINEAR in φ(x) and in α — so convex optimization still converges efficiently | best of both |
You have already seen a feature map: chapter 2’s Cartesian→polar morph is exactly turning a linearly-inseparable problem into a separable one —
Why the trick is powerful: (1) nonlinear models via convex optimization (φ is fixed; only α is learned); (2) is often far cheaper than building φ — which can even be infinite-dimensional. The book’s example: over non-negative integers, φ(x) = x ones followed by infinitely many zeros has the perfectly tractable kernel . The most-used kernel is the Gaussian (RBF) kernel — corresponding to an infinite-dimensional space, and acting as template matching: a training example near the test point fires strongly, and the prediction blends training labels weighted by similarity.
Costs, support vectors — and the torch-passing
Prediction costs O(m) — one kernel term per training example — mitigated because SVMs learn mostly-zero α: only the support vectors matter at test time. Training, though, builds an m×m Gram matrix: O(m²), hopeless for billions of examples. Generic kernels also generalize poorly on AI tasks (§5.11 explains why). The modern deep-learning era opened precisely here: Hinton et al. (2006) showed a neural network beating the RBF SVM on MNIST.
Next: the remaining simple learners — nearest neighbors and decision trees — and the unsupervised side: k-NN, trees, PCA and k-means.
Check yourself — MAP, logistic regression, kernels
1.How does MAP estimation relate ML estimation and Bayesian inference?
2.Which regularizers can NOT be interpreted as MAP inference?
3.Why does binary classification need the sigmoid where linear regression needed nothing?
4.What are the kernel trick's two claimed powers?
5.Why did kernel machines cede the stage to deep learning?