Lesson 3.1foundation2 h 30 min

What is learning? ERM, generalization and the ML workflow

The one idea every model in this path is a special case of

Linear regression, gradient-boosted trees, GPT and a diffusion model all do the same thing: pick a function from a family to make a loss small on data, in the hope that it stays small on data they have not seen. That hope has a name — generalization — and a mathematics that explains when it is justified. Learn this framing once and the rest of the path becomes a catalogue of choices for the hypothesis space, the loss and the optimizer (3.2 Linear regression, 4.1 From perceptron to MLP; universal approximation, 7.6 Decoder-only: GPT and autoregressive generation).

You'll be able to

  • Define a learning problem by its task, experience and performance measure, and classify it as supervised, unsupervised, self-supervised or reinforcement learning
  • Write down true risk, empirical risk and the ERM principle, and explain why minimizing training error is not the same as learning
  • Decompose excess error into approximation and estimation error and connect them to underfitting and overfitting
  • Explain the roles of training, validation and test splits and why the test set is touched once
  • State the no-free-lunch idea and give the inductive bias of three model families
  • Run the ML workflow from problem framing to a monitored deployment, baseline first

Key ideas

  1. A learning problem is a triple (task, experience, performance measure); write it down before coding.
  2. ERM: choose the hypothesis that minimizes average training loss; true risk is the expected loss on new data and is what we actually want.
  3. Training error is optimistically biased because the model was selected using it; the generalization gap grows with hypothesis-space complexity and shrinks like 1/√n.
Show 4 more key ideas
  1. Excess error = approximation error (hypothesis space too small → underfitting) + estimation error (too large for the data → overfitting).
  2. Train fits, validation selects, test is touched once; information must never flow from validation/test into training.
  3. No free lunch: no algorithm is best on all problems; learning works when the model's inductive bias matches the data's structure.
  4. Workflow: frame → split → explore → baseline → iterate one change at a time → evaluate with error bars → ship and monitor drift.

Suggested path through this lesson