K-Nearest Neighbors Algorithm

Please explain this line bit in detail - " Larger values of K will have smoother decision boundaries which means lower variance but increased bias "

And how can we draw decision boundary for knn ?

Hey @gautam75,
First understand that bias means training error and variance means error at testing time.

So when you will higher values of k, for example 50. Then you will be encountering a large number of different nodes to get the correct label for you particular node, means you might be considering those points that are far from it and hence your bias increases a lot.

But on testing time, this thing might be bit helpful, as it becomes a type of ensembling that varifies that our predictions are dependent on large number of points hence might be true. So it reduces variancr in such a way.

Decision boundaries being smooth means, you will be a smooth curve Or line not like being in a zig zag order or distorted.
You can plot it using sklearn module.
Do check it’s documentation first.
I hope this helps.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.