Learning From Data (Abu-Mostafa) — Book Notes

Book notes: the theory of why machine learning works at all — feasibility of learning, VC dimension, bias-variance, and overfitting.

Authors: Yaser Abu-Mostafa (Caltech), Malik Magdon-Ismail, Hsuan-Tien Lin (2012)

The companion book to Abu-Mostafa’s Caltech course CS 156. Short (~200 pages), mathematically serious, and focused on one question most ML books skip: why is learning from data possible at all?

The Learning Problem

Setup: an unknown target function f maps inputs to outputs. You have a finite sample of data generated by f. Learning = choosing a hypothesis g from a hypothesis set H that approximates f well on data you haven’t seen.

The tension: you only ever measure performance on the sample (in-sample error, E_in), but you care about performance on new data (out-of-sample error, E_out).

Feasibility of Learning

A finite sample can’t tell you anything about f outside the sample — deterministically. The escape is probabilistic: Hoeffding’s inequality bounds the probability that in-sample frequency deviates far from out-of-sample probability.

The catch: Hoeffding applies to one fixed hypothesis. When you choose the best hypothesis from many, the bound degrades with the size of the hypothesis set. Learning is a trade-off:

VC Dimension

The book’s centerpiece. For infinite hypothesis sets, counting hypotheses fails — what matters is the growth function: how many distinct ways the hypothesis set can classify N points.

The VC dimension d_vc is the largest N the hypothesis set can shatter (classify in all 2^N ways). If d_vc is finite, the growth function is polynomial, and generalization is guaranteed with enough data.

Rule of thumb from the book: you need roughly N ≥ 10 × d_vc data points for decent generalization.

For a linear perceptron in d dimensions: d_vc = d + 1 — the number of parameters. More parameters, more data needed. This is the theoretical backbone of “model complexity.”

Bias-Variance

The other decomposition of generalization error:

Matching model complexity to data resources, not target complexity, is the practical lesson.

Overfitting, Regularization, Validation

Key Takeaways

Why It Stuck With Me

Most practical ML education is recipes. This is the physics underneath — after it, you know why a validation set works, why more parameters demand more data, and why leakage silently destroys everything.