For two classes, how do you derive the asymptotic error of the 3-nearest-neighbour rule as a function of the posterior , and how do you show that it is never worse than the 1-NN rule at every ? What are the errors of both rules when the local Bayes error is ?
Supervised learning, k-nearest neighbours
Level L5 Expert. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can extend the Cover–Hart argument to a majority vote of three independent labels.
Key idea
With three neighbour labels distributed as independent Bernoulli(), the conditional 3-NN error is .
Steps
- As , the three nearest neighbours of converge to , and their labels are independent draws of Bernoulli() with , independent of the test label .
- The vote is wrong when the test label is 1 and at least two neighbours say 0, or the test label is 0 and at least two say 1.
- . .
- Error: .
- The bracket equals . So .
- Compare with . With : and . Then , which is always true.
- Numbers: (so or , ): and . Both are above the Bayes value , but 3-NN is much closer.
- Sanity check: at , , , the Bayes error, as it should be.
Common mistakes
- Using only and forgetting the term for exactly two disagreeing neighbours.
- Forgetting that the test label is independent of the neighbours' labels given , which is what allows the product.
- Assuming that more neighbours helps at fixed . This is an asymptotic statement with .
How long your answer should be
About a page; 7 minutes.
Read this
Previous in Supervised learning: For a hard-margin SVM trained on linearly separable points, how do you prove that the leave-one-out error is at most , where is the number of support vectors, and what does this imply about the expected test error?
Next in Supervised learning: Write the optimality (KKT) conditions for the lasso . Using them, what is the smallest at which , and how do you verify that is the solution for , , ?