Learning Theory I — Empirical Risk Minimisation
Loss, risk, empirical risk, and the definition of the learning algorithm.
This is the single most-quoted deck in short-answer questions. The formula chain loss → risk → empirical risk → ERM is the answer to "What is Empirical Risk Minimization? Why the term empirical?" and it recurs in the SVM and regularisation decks.
The learning problem, formally
Given a domain set $\mathcal{X}$, a label set $\mathcal{Y}$, and a joint distribution $P(x,y)$ over $\mathcal{X}\times\mathcal{Y}$:
- input $x \in \mathbb{R}^d = \mathcal{X}$
- output $y \in \{-1,+1\}$ for binary classification
- unknown target function $f:\mathcal{X}\to\mathcal{Y}$, the true relationship between $x$ and $y$
- data $D = \{(x_1,y_1),\dots,(x_N,y_N)\}$
- a hypothesis set $\mathcal{H} = \{h_1,h_2,\dots\}$
- a learning algorithm $A$ that picks $g \approx f$ from $\mathcal{H}$ using $D$

$f$ cannot be known, so the best you can do is pick the hypothesis $g$ that best represents it on the data you have. Everything that follows is a way of making "best represents" precise.
The formula chain
This is the slide you should be able to reproduce verbatim.

Loss — how wrong one prediction is:
$$L(\hat{y}, y) = \begin{cases} 1 & \text{if } \hat{y} \neq y \\ 0 & \text{if } \hat{y} = y \end{cases}$$
Risk — the expected loss over the true (unknown) distribution:
$$R(h) = \mathbb{E}[L(h(x), y)] = \int L(h(x), y)\, dP(x,y)$$
Empirical risk — the average loss you can actually compute:
$$R_{\text{emp}}(h) = \frac{1}{n}\sum_{i=1}^{n} L(h(x_i), y_i)$$
ERM — the learning algorithm defined by minimising it:
$$\hat{h} = \arg\min_{h \in \mathcal{H}} R_{\text{emp}}(h)$$
The slide notes explicitly that $R(h)$ cannot be computed because $P(x,y)$ is unknown — this is called agnostic learning. That sentence is the "why empirical" part of the answer, and it is worth a mark on its own.
Why the word "empirical"
Because the quantity being minimised is not the true risk $R(h)$ — it is the risk estimated from the empirical sample $D$. It is a finite-sample average standing in for an expectation over a distribution you never observe. The justification for that substitution is exactly what PAC learning (next lecture) formalises: under a finite $\mathcal{H}$ and enough i.i.d. samples, empirical risk minimisation is probably approximately correct.
Model answer — "What is ERM? Why the term empirical? Explain its role in learning theory." ERM is the principle of choosing the hypothesis $\hat h$ from a hypothesis class $\mathcal{H}$ that minimises the average loss on the training sample, $\hat h = \arg\min_{h\in\mathcal{H}} \frac{1}{n}\sum_i L(h(x_i),y_i)$. It is empirical because the true risk $R(h)=\mathbb{E}[L(h(x),y)]$ requires the unknown data distribution $P(x,y)$ and is therefore incomputable; the sample average is an empirical estimate of it. Its role in learning theory is to convert learning into a well-posed optimisation problem, and to serve as the object that generalisation theory bounds: PAC results show that for a finite hypothesis class, ERM on enough i.i.d. samples returns a hypothesis whose true risk is within $\epsilon$ of the best in $\mathcal{H}$ with probability at least $1-\delta$.
Probability vocabulary you are assumed to have
- Sample space — the set of all possible outcomes of an experiment.
- Random variable — a mapping that assigns a real number to each outcome ($\text{Head}\to 1$, $\text{Tail}\to 0$).
- Discrete vs continuous — separate distinct values (a die, a coin) versus real numbers in an interval (weight, temperature).
- Joint $P(X,Y)$; conditional $P(X\mid Y)$.
- i.i.d. — random variables are independent and identically distributed iff they are mutually independent and share the same distribution.

The running example
Every deck uses the same patient:
| Field | Value |
|---|---|
| Gender | F |
| Age | 80 |
| Hypertension | 0 |
| Heart disease | 1 |
| Smoking history | never |
| BMI | 25.19 |
| HbA1c | 6.6 |
| Blood glucose | 140 |
| Diabetic | ? |
The inputs are the independent variables; Diabetic is the dependent variable. There is no closed-form diagnosis formula — but hospitals hold many such records, so "there must exist some pattern, we don't know it". That is the premise of supervised learning in one sentence.







































