Lesson 1.4 · 6 min read · about 45 min to master at a very slow pace
Fundamental Limits of Machine Learning
The No Free Lunch theorem, why no algorithm is best for every problem, and the conditions that make learning from data possible at all.
No Free Lunch
The No Free Lunch theorem (Wolpert) says that, averaged over all possible problems, no learning algorithm beats any other. An algorithm that does brilliantly on one family of problems must do correspondingly worse on another.
What it means in practice
There is no universally best model. A method works when its assumptions suit the problem. So you compare candidate methods on data relevant to your task, and you make your assumptions explicit.
Common misreading
No Free Lunch does not say all algorithms perform equally on your dataset. It is an average over every conceivable problem, most of which look like noise. Real problems have structure, and an algorithm whose assumptions match that structure will do better.
Why learning is possible at all
Training examples alone can never pin down what happens at inputs you haven't seen. Learning works only because of two things:
- Structure: the real relationship is reasonably smooth or simple, so nearby inputs have similar outputs.
- Representative data: enough observations, drawn from the same population you will predict for.
Every model brings assumptions (its inductive bias): linear regression assumes a straight-line relationship, K-NN assumes nearby points behave alike. Those assumptions are what let it fill in the gaps between training points.
The promise behind every model
Most methods assume training and future data are independent draws from the same distribution. If you train on patients from one hospital and deploy in another country, that promise is broken, and the model can fail however clever the algorithm.
Two cultures (background)
Leo Breiman's essay Statistical Modeling: The Two Cultures contrasts the data-modelling culture (assume a stochastic model, check goodness of fit, interpret parameters) with the algorithmic culture (treat the mechanism as unknown, judge models by predictive accuracy). Two ideas from it are useful later:
- Rashomon effect: many quite different models can fit equally well, so individual coefficients can be unstable (see multicollinearity, 3.9).
- Occam's razor: a tension between simplicity and accuracy, which regularisation (Section 5) manages explicitly.
Cheatsheet
No Free Lunch
NFL misreading
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.