What it means to learn from data¶
Classical machine learning is the study of how a program can get better at a task from examples instead of instructions: choose a family of models, a loss and an algorithm, fit to data, and above all check that the fit carries over to data you have not seen. Every idea in deep learning and LLMs stands on this track.
10,000 ft
Before neural networks took over perception and language, machine learning had already worked out the fundamentals: how to fit a model by minimising a loss, why fitting too well is a failure, how to measure generalisation honestly, how penalties and averaging tame variance, and how to turn messy records into useful inputs. Those ideas did not go away. A language model's output layer is softmax regression; its training loss is the cross-entropy derived on that page; its optimiser's weight decay is ridge regression's penalty; benchmark contamination is the leakage this track teaches you to hunt. And in industry, much of the machine learning that moves money (credit, fraud, pricing, demand forecasting, churn) still runs on tabular features with linear models and gradient-boosted trees. This track gives you the vocabulary and the instincts that the rest of the site assumes.
The learning problem in one picture¶
Tom Mitchell's 1997 textbook gave the definition most people still quote: "A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E." For a spam filter, T is labelling emails, P is the fraction labelled correctly, and E is a pile of emails people have already marked. The phrase "machine learning" itself is usually credited to Arthur Samuel, whose 1959 checkers program improved by playing against itself.
Made precise, supervised learning has five ingredients, and every page in this track is about one or more of them:
- An unknown target. Some true relationship between inputs \(\mathbf{x}\) and outputs \(y\), usually noisy, so best thought of as a distribution \(p(y\mid\mathbf{x})\).
- Data. \(n\) examples drawn from the world, ideally independently, from the same distribution you will face later.
- A hypothesis class. The set of functions you allow yourself: linear maps, trees, kernel machines, networks. Choosing it is choosing an inductive bias.
- A loss. A number that says how bad a prediction is. Usually it is the negative log-likelihood of a noise model: squared error for Gaussian noise, cross-entropy for categorical labels (linear regression: first principles).
- An algorithm that searches the class for the function with low loss on the data, plus a penalty or other preference for simplicity: empirical risk minimisation with regularisation.
The output is judged not on the training data but on new examples from the same world. That gap, between fitting what you have and predicting what you have not seen, is generalisation, and it is the central question of the field. It is why a 15-parameter polynomial through 15 points is a failure, why bias and variance trade off, why evaluation is a discipline of its own, and why learning theory exists.
Three kinds of experience¶
- Supervised learning: examples come with the right answer (a label or a number). Regression and classification. Most of this track.
- Unsupervised learning: no labels; find structure, such as groups (clustering), low-dimensional directions (PCA and friends) or a density (probabilistic models). Self-supervised learning, which trains LLMs, manufactures labels from the data itself (predict the next token) and then trains exactly like supervised learning.
- Reinforcement learning: the experience is the consequence of the learner's own actions, a reward rather than a label (the RL track).
Two truths that frame everything¶
There is no free lunch. Averaged over every conceivable target function, no learning algorithm beats any other, including random guessing (Wolpert, 1996). Learning works in practice only because real-world targets are not arbitrary: they are smooth, sparse, compositional, invariant to some transformations. Every successful method encodes a bet about which; the bet is its inductive bias. "Which model is best?" has no answer without "for which kind of data?".
Two cultures. Leo Breiman (2001) described statisticians who start from a model of how the data were generated, and fit its parameters to understand the mechanism, versus machine learners who treat the mechanism as unknown and judge a model only by its predictive accuracy on held-out data. Modern practice uses both: logistic regression's odds ratios for explanation, gradient boosting or a network for prediction, and the held-out test as the referee. This track keeps both lenses open: every model is derived from a probabilistic story, and every model is judged on unseen data.
Ideas deep learning never stopped using¶
| Classical idea | Learn it in | Where it lives in modern AI |
|---|---|---|
| Least squares, the linear map | Linear regression | every linear layer; linear probes in interpretability; regression heads |
| Maximum likelihood, softmax + cross-entropy | Logistic regression | the LLM pre-training loss; every classifier head; temperature |
| Gradient descent and conditioning | Linear regression | optimisers, normalisation layers, why Adam rescales coordinates |
| Regularisation: weight decay, early stopping | Bias, variance and regularisation | AdamW's weight decay; dropout; early stopping in fine-tuning |
| Bias–variance, double descent | Bias, variance and regularisation | why giant over-parameterised models generalise; scaling laws |
| Held-out evaluation and leakage | Metrics, validation and leakage | benchmark contamination; eval hygiene; LLM-judge calibration |
| Features and representations | Features and tabular data | embeddings; tabular foundation models; feature stores in production |
| Bagging and boosting | Trees and ensembles | the production default for tabular data; ensembling and distillation |
| Kernels and similarity | Kernels and SVMs | attention as a learned similarity-weighted average; the neural tangent kernel |
| k-means, mixtures, EM | Clustering and mixtures | vector quantisation; inverted-file indexes for vector search |
| SVD and PCA | Dimensionality reduction | low-rank adapters (LoRA); embedding visualisation |
| PAC, VC and generalisation bounds | Learning theory | the open question of why deep networks generalise |
| Latent-variable models | Probabilistic graphical models | VAEs and diffusion models as latent-variable models |
The map of this track¶
Box styles mark the four kinds of page: supervised models, the evaluation ideas that apply to all of them (the two gate-shaped boxes), unsupervised methods, and theory. The first unit (this page through features) is the core every later track assumes. The second unit broadens the toolbox and then deepens the theory.
How to work through this track¶
Times are for studying properly (deriving, running the code, answering the questions), not for reading.
- Core path, about 7 hours. Linear regression (75 min) → Logistic regression (75 min) → Bias, variance and regularisation (90 min) → Metrics, validation and leakage (80 min) → Features and tabular data (80 min). After this you can build, regularise, evaluate and debug a real model, and you have the concepts the deep learning track builds on.
- The toolbox, about 6 hours. Trees and ensembles (the tabular workhorse), Kernels and SVMs, Clustering and mixtures, Dimensionality reduction. Read trees first if you work with business data.
- The theory, about 4 hours. Learning theory and Probabilistic graphical models. Read these when you want to know why things generalise and before the generative models track.
If you are heading straight for LLMs: do the core path, then jump to deep learning; come back for unit 2 later. If you build products on tabular data (credit, risk, forecasting): core path plus trees and ensembles first.
Pages in this track¶
-
Linear regression from scratch
Least squares three ways (by hand, by normal equations, by gradient descent), the projection picture and the Gaussian likelihood.
-
Logistic regression and classification
Log-odds, the sigmoid, cross-entropy, Newton's method, calibration, thresholds and softmax: the output layer of every LLM.
-
Bias, variance and regularisation
The decomposition by simulation, ridge and lasso with their geometry, and double descent.
-
Metrics, validation and leakage
Splits, cross-validation, ROC versus PR, proper scoring rules, confidence intervals and every way the future leaks into training.
-
Scaling, encodings, target encoding done safely, time features, point-in-time aggregates, and trees versus networks on tables.
-
Decision trees, random forests and boosting
Recursive splitting, bagging to cut variance, gradient boosting to cut bias: the tabular champions.
-
Kernels and support vector machines
Maximum margins, the kernel trick and infinite feature spaces without computing them.
-
k-means, Gaussian mixtures and the expectation–maximisation algorithm for hidden structure.
-
Finding the few directions that matter, and drawing high-dimensional data honestly.
-
Learning theory: PAC, VC and double descent
What can be learned from how much data, and how modern over-parameterised models broke the classical bounds.
-
Probabilistic graphical models
Bayesian networks, Markov random fields, latent variables and inference: the probabilistic backbone of generative AI.
The five best resources for this track¶
- An Introduction to Statistical Learning — James, Witten, Hastie and Tibshirani (free PDF, R and Python editions). The gentlest rigorous introduction; read it alongside the core path.
- The Elements of Statistical Learning — Hastie, Tibshirani and Friedman (free PDF). The graduate reference: the place to go when a page here says "derived elsewhere".
- Stanford CS229: Machine Learning, Autumn 2018 — Andrew Ng, with the course notes. The canonical lecture course: derivations at the board, from linear regression to EM.
- Learning From Data — Yaser Abu-Mostafa, Caltech. 18 lectures centred on the generalisation question; the clearest treatment of bias–variance, VC dimension and validation.
- Probabilistic Machine Learning: An Introduction — Kevin Murphy (free PDF). Every model on this track as a probabilistic model, with modern notation and code.
For a short, opinionated overview to read first, Pedro Domingos' A Few Useful Things to Know About Machine Learning (2012) packs the folk wisdom of the field into nine pages, and Breiman's Statistical Modeling: The Two Cultures (2001) is the essay to argue with.
Before you start¶
This track uses, and links back to, these pages from the mathematical foundations track:
- Vectors, dot products and geometry and matrices as linear maps: every model here starts from \(X\mathbf{w}\).
- Derivatives and gradients: to derive the normal equations and the logistic gradient.
- Eigenvectors, SVD and PCA: for conditioning, ridge shrinkage and dimensionality reduction.
- Probability from first principles and MLE, MAP and Bayes: every loss on this track is a negative log-likelihood, every penalty a prior.
- Entropy, cross-entropy and KL: the classification loss.
- Optimisation and statistics for experiments and evals: convergence, confidence intervals, tests.
You need Python with NumPy (your workbench); every code block on this track runs in a second or two on a laptop.
Where this leads¶
- Deep learning at 2,000 ft — stack learned features under the linear and logistic models of this track.
- Large language models at 2,000 ft — softmax regression over a vocabulary, at scale.
- Data at 2,000 ft — where training data comes from and how it stays honest in production.
- Safety and evaluation at 2,000 ft — evaluation, scaled up to frontier models.