What does the no-free-lunch theorem say, and what does it imply for choosing a learning algorithm in practice?
Foundations, Generalisation
Level L4 Advanced. Length Medium. Nature Th Theoretical.
What's being asked
Whether you understand why every learner needs built-in assumptions, and can state the theorem without overclaiming.
Key idea
Averaged over all possible target functions, with each one equally likely, every learning algorithm has the same expected error on points it has not seen. A gain on some problems is paid for by a loss on others. Learning works only because real problems are not random.
Steps
- State it (Wolpert, 1996). Take any two algorithms A and B, and average over all possible target functions on a finite input space. Their expected error on inputs outside the training set (the off-training-set error) is the same.
- Give the intuition. If every labelling of the unseen points is equally likely, the training set tells you nothing about them. Every prediction there is a coin toss.
- Implication 1: no algorithm is best for every problem. “Gradient boosting beats k-NN” is a claim about the problems we actually meet, not about all possible problems.
- Implication 2: every algorithm makes assumptions, such as smoothness, linearity, locality, or translation invariance. These are its inductive bias. Choose an algorithm whose assumptions fit your domain, and compare candidates on your data with cross-validation.
Common mistakes
- Saying “all algorithms perform equally on real problems”. The average is over all possible functions, and most of those look like noise.
- Dropping the words “off-training-set”. On the training points themselves, algorithms can differ.
- Using the theorem as a reason not to compare models. It is exactly why you must compare them.
How long your answer should be
Half a page; 2–3 minutes: state the off-training-set result, the coin-toss intuition, and both practical implications.
Read this
Previous in Foundations: Derive the number of monomial features of degree at most in input variables, using a stars-and-bars counting argument. Check it for by listing the terms, then evaluate it for and explain why a polynomial kernel avoids building these features?
Next in Foundations: For least-squares linear regression with hat matrix , how do you prove that the leave-one-out residual is , so that leave-one-out cross-validation needs only one fit?