How to manually compute KNN

Dr. Ballings,

I have read the K Nearest Neighbors section of the book, read all of the questions and answers on this forum, as well as referenced YouTube
Google, and I am still not sure how to begin this problem. I understand that I should be using a for loop, but I don't understand how to
utilize the for
loop since there is no reference to such a problem anywhere in the book--the only example I see is the single example that uses the
algorithm. Do
you have any suggestions as to where I can find some information that may help me solve this problem?

Thank you,

Answers and follow-up questions

Answer or follow-up question 1

Dear Lauren,

For your convenience, here are all the questions about KNN:

Here are two specific questions about the loop for KNN:

Also make sure to revise Section ' Creating loops' in the book.

These give you all the elements that allow you to break down the problem in smaller problems,
and solve the exercise.

If you still have questions after reviewing the above, make sure to ask specific questions about subproblems.

Michel Ballings

Sign in to be able to add an answer or mark this question as resolved.