Learning Theory II — Generalisation, PAC, Learning Types
Train/test split as the measurement of generalisation, PAC bounds, and the taxonomy of learning.
The bridge from "minimise training error" to "perform on data you have never seen".
Generalisation
> Generalisation is performance on new data drawn from the situation we care about.

- Good generalisation — learns useful patterns, works on new data.
- Poor generalisation — memorises training examples, struggles on new data.
The operational definition is a partition: the training set is used to fit and select the hypothesis; the test set measures generalisation. This is the seed of the whole W5L3 validation deck.
PAC learning
PAC (Probably Approximately Correct). ERM with respect to a finite hypothesis class, applied to a sufficiently large training sample, outputs a hypothesis that is probably approximately correct.

Two parameters do two different jobs — this distinction is the mark:
- $\epsilon$ — how far the output classifier can be from the optimal one. That is the approximately correct part.
- $\delta$ — how likely the classifier is to meet that accuracy requirement. That is the probably part.
Sample complexity $m_{\mathcal{H}} : (0,1)^2 \to \mathbb{N}$ answers "how many examples are required to guarantee a PAC solution?" Every finite hypothesis class is PAC learnable, and the bound has the shape
$$m_{\mathcal{H}}(\epsilon,\delta) \;\ge\; \frac{\log|\mathcal{H}| + \log(1/\delta)}{\epsilon}$$
so sample size grows logarithmically in the size of the hypothesis class and quadratically in $1/\epsilon$. That log-in-$|\mathcal{H}|$ is the single most quotable consequence: a bigger hypothesis class is affordable, but only logarithmically.

The three learning settings
| Setting | Data | Goal | Course examples |
|---|---|---|---|
| Supervised | $D=\{(x_i,y_i)\}$ — labels present | predict $y$ for a new $x$ | classification, regression |
| Unsupervised | $D=\{(x_i,?)\}$ — no labels | discover structure | clustering, dimensionality reduction |
| Reinforcement | $(x_i, \text{output}, \text{grade of output})$ | maximise reward through actions | agent–environment loop |



The reinforcement slide uses tic-tac-toe: current state → action → reward (+/−). The feedback loop between the learning system and its experience is what distinguishes it from the other two.
Additional settings named but not developed: semi-supervised, self-supervised, multi-task, active, curriculum learning.
If asked "supervised vs unsupervised with concrete examples": give the definition of the data first (labels present vs absent), then one example each from the course — logistic regression on the diabetes table (supervised, because the Diabetic column exists) versus k-means on the same table with the label column deleted (unsupervised). Using one dataset twice makes the contrast sharper than two unrelated examples.






















