Using too low a value of K gives over fitting.
But how is overfitting prevented:
- How do we make sure K is not too low
- And are there any other precautions taken in k-nn that help prevent over fitting.
Using too low a value of K gives over fitting.
But how is overfitting prevented:
This relates to the number of samples that you have and the noise on these samples.
For instance if you have two billion samples and if you use $k=2$, you could have overfitting very easily, even without lots of noise.
If you have noise, then you need to increase the number of neighbors so that you can use a region big enough to have a safe decision.
But for a ballpark estimate, I would start with $k=log(nb samples)$, and I would increase $k$ depending on the level of noise in my samples.