§5.2.2 Regularization
No free lunch says design for specific tasks — by building preferences into the learner. Changing the hypothesis space (degree) was the blunt version; the refined version keeps all functions eligible but prefers some: the unpreferred win only by fitting significantly better. The flagship: weight decay weight decay The L² regularizer: J = MSE + λwᵀw; trades data fit against small weights; = MAP with a Gaussian prior; = ch4's constrained optimization. defined in ch. 5 — open in glossary for linear regression —
Term by term
| fit the data | data term | |
| the REGULARIZER Ω(w): prefer small squared L² norm — smaller slopes, weight on fewer features | preference term | |
| preference strength, chosen ahead of time: λ = 0 imposes nothing; large λ forces weights toward zero — this is ch. 4’s constrained optimization wearing its penalty coat | scalar ≥ 0 |
Fig 5.5 live — the same degree-9 model as last section, tamed and un-tamed by λ:
train 0.018 · test 50.985
overfittingThe definition worth memorizing
Regularization regularization Any modification intended to reduce generalization error but not training error — preferences among hypothesis-space members (e.g. weight decay λwᵀw). defined in ch. 5 — open in glossary is any modification made to a learning algorithm that is intended to reduce its generalization error but not its training error. Excluding functions = an infinitely strong preference against them; penalties are the graded version. It rivals optimization as the field’s central concern — and (NFL again) there is no best form, only forms suited to tasks. Deep learning’s bet: very general-purpose regularizers can serve the whole range of intellectual tasks. Chapter 7 is this idea grown up.
§5.3 Hyperparameters and validation sets
Settings like the polynomial degree and λ are hyperparameters hyperparameter A setting not adapted by the learning algorithm itself (degree, λ) — tuned on the validation set, never the test set. defined in ch. 5 — open in glossary : values the learning algorithm does not itself adapt. Sometimes because they’re hard to optimize — more often because learning them on the training set would always choose maximum capacity (higher degree, λ = 0: guaranteed overfitting). They need data the trainer never observes: the validation set validation set A split of the TRAINING data (~20%) held out to select hyperparameters; the test set stays untouched until the end. defined in ch. 5 — open in glossary , split off from the training data (typically 80 % train / 20 % validation) — never from the test set, which must make no choices about the model:
Since the validation set “trains” the hyperparameters, its error underestimates generalization error too (less than training error does); the final estimate comes from the untouched test set.
Aside — even test sets go stale
When a community benchmarks against the same test set for years — counting every attempt to beat the state of the art — evaluations become optimistic there as well. Benchmarks age; the field moves on to newer, larger, more ambitious datasets.
§5.3.1 Cross-validation
A small test set means high statistical uncertainty in the error estimate — hard to claim algorithm A beats B. When data is scarce, k-fold cross-validation cross-validation k-fold: split data into k parts, train on k−1, test on 1, rotate — all data contributes to the error estimate (algorithm 5.1). defined in ch. 5 — open in glossary uses all of it, at k× the compute:
- 1split into mutually exclusive subsets , union ⓘ
- 2for from 1 to doⓘ
- 3ⓘ
- 4for in do ⓘ
- 5end for; return ⓘ
§5.4 → §5.4.1 Point estimation
Statistics gives the tools to formalize generalization. The atom is the point estimator point estimator Any function of the data θ̂ = g(x⁽¹⁾…x⁽ᵐ⁾); good ones land near the true θ. defined in ch. 5 — open in glossary — any function of the data offering a single “best” guess of a quantity:
Term by term
| ANY function of the data qualifies as a point estimator (statistic) — the definition demands nothing, so quality must be analyzed separately (bias §5.4.2, variance §5.4.3) | arbitrary | |
| the estimate — frequentist view: the true θ is FIXED but unknown; θ̂ is a RANDOM VARIABLE because the data is random | random | |
| function estimation (predict y from x, y = f(x) + ε) is the same thing — a point estimator in function space, as with linear regression’s w | special case |
The good-estimator vocabulary — bias, variance, and their trade-off — is next.
Check yourself — regularization and validation
1.In the fig 5.5 widget (degree fixed at 9), predict the three λ regimes.
2.What is the book's exact definition of regularization?
3.Why can't capacity hyperparameters (degree, λ) be learned on the training set?
4.Why must the validation set come from the training data rather than the test set?
5.What does k-fold cross-validation buy, and at what price — plus its statistical caveat?