## ← 06ps-12 K Nearest Neighbors Solution

• 1 Follower
• 16 Lines

Homework 3 4 k Nearest Neighbors ANSWER

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=01qBi27m3Ss" data-team="udacity"></div> ``` 3 Languages

Showing Revision 1 created 11/28/2012 by Amara Bot.

1. And the answer would be this box over here
2. and this box over here, nothing else.
3. This guy has clearly 4 positive nearest neighbors,
4. so no matter what the 5th one is we stay positive.
5. Similarly, this guy over here,
6. when you draw a circle,
7. has probably these 4 guys as nearest neighbors,
8. perhaps this one as well, but it is a little further away.
9. With those 4 ones, it already has 3 pluses,
10. so whatever the 5th one is it can't overturn, it must be positive.
11. All of these are negative, even this one over here has just 2 pluses as neighbors
12. that are positive, and those guys over here are all negative.
13. Similarly, over here there are possibly 2 pluses
14. in the 5 nearest neighbors,
15. but these guys over here are all negative, and this guy is
16. surrounded by negative examples, so they will just be negative.