Knn doubt pls explain explain

why is vals first declared,why is vals appended with y ,please explain

could be clear much with the algo

Hey @silpasweta, for every point we need to two things to make predictions, first is the distance from the query point, second is the class to which it belongs, so that we may make final predictions.

Hope this resolved your doubt.
Plz mark it as resolved in my doubts section. :blush:

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.