Why is the predictor that minimises the expected squared loss the conditional mean , and why is the classifier that minimises the expected 0-1 loss ?
Foundations, Statistical decision theory
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can minimise an expected loss one input at a time, and know which “ideal” model each loss is aiming for.
Key idea
Write the risk as and minimise the inner part separately for each . For squared loss the inner part is a parabola in the prediction , lowest at . For 0-1 loss, predicting class costs .
Steps
- Use the tower rule to write . The value can be chosen separately for each , so it is enough to make the inner term as small as possible at every .
- Squared loss. Let and add and subtract it: The cross term is zero, because has mean zero given .
- The first term does not depend on , and the second is smallest (zero) at . So . What is left, , is noise that no model can remove.
- 0-1 loss. This loss is 1 for a wrong class and 0 for the right one. Predicting class gives expected loss , which is smallest for the class with the largest posterior probability. So .
- Name the result. This is the Bayes classifier, and its error is the Bayes error. No classifier can do better.
- Add a remark. The same argument with absolute loss gives the conditional median. The loss you train with decides what your model is estimating.
Common mistakes
- Minimising over all functions at once without explaining why you may do it one at a time.
- Saying the Bayes classifier has zero error. Its error is zero only when the classes do not overlap.
- Confusing the Bayes classifier with naive Bayes, which is one particular model that tries to approximate it.
How long your answer should be
Half a page; about 4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Foundations: For a single weight and a number , solve and . Why does this show that L1 regularisation gives sparse solutions and L2 does not?
Next in Foundations: Consider a -dimensional unit-radius hypersphere inscribed inside the hypercube . Using the hypersphere volume (where for an integer ), what fraction of the hypercube's volume does the sphere occupy for , and , and what does this imply about uniformly sampled points in high dimensions?