ML Methodology · Activity 4

LOOCV for k-NN classification

Hold out one labeled example, classify it using only the remaining examples, and repeat. The CV error is the number of held-out points misclassified.

Predict first: Why is LOOCV error for 1-NN not automatically zero, even though 1-NN has zero training error when every training point can be its own nearest neighbor?

One leave-one-out step

Class 0Class 1Held-out pointlines = neighbors voting for prediction
Point 1 is held out. Ask the class to predict its label before revealing.

Which k would you choose?

kLOOCV mistakesLOOCV error