Under what conditions on does the k-NN classifier approach the Bayes error as ? Why does a fixed not suffice, and why is a sensible choice?
Supervised learning, k-nearest neighbours
Level L4 Advanced. Length Medium. Nature Th Theoretical.
What's being asked
Whether you understand the two requirements for consistency, one for variance and one for bias.
Key idea
k-NN is consistent when (variance vanishes) and (neighbourhoods shrink, so bias vanishes).
Steps
- k-NN estimates the posterior as the fraction of the nearest labels that are 1. This is an average of labels. Its variance is about .
- To make that variance vanish, we need . A fixed leaves a constant variance, so the estimate of stays noisy. (A fixed gives an error strictly above Bayes in general, between and .)
- The bias comes from the neighbourhood size. The nearest points lie within radius , where is the volume of the unit ball in dimensions. If the radius goes to 0, and is almost constant on the neighbourhood.
- Both conditions together (, ) give consistency for every distribution (Stone, 1977): .
- satisfies both: and . It is a common rule of thumb rather than the exact optimum, because the best growth rate of depends on the smoothness of and on the dimension . In high dimensions, you need much larger before the neighbourhood is small, which is the curse of dimensionality.
Common mistakes
- Saying more neighbours is always better. If does not go to 0, the neighbourhood covers the whole space and bias stays.
- Claiming that 1-NN is consistent. It is not, except in trivial cases such as .
- Giving the conditions without saying which one controls bias and which controls variance.
How long your answer should be
Half a page; 4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: LDA and logistic regression both give linear decision boundaries. When would you expect each to do better, and why, in terms of data size, model correctness and outliers?
Next in Supervised learning: Two classes have densities and with equal priors. Show that the Bayes error is , where and is the standard normal cdf. What is its value for , , , and how does it compare with the Bhattacharyya bound?