In: Statistics and Probability
Customer |
Response |
Distance to Jack |
Distance to Colleen |
Janet |
Yes |
1.7 |
1.3 |
Adam |
Yes |
1.6 |
1.3 |
Tom |
No |
3.8 |
0.9 |
Sarah |
Yes |
2.4 |
1.2 |
Nancy |
No |
3.7 |
0.9 |
Joseph |
No |
2.5 |
1.5 |
What will be the predicted responses of Jack and Colleen using k-NN when k is set to the following values? Justify your answer.
ANSWER::
RESPONSES OF JACK:
When K=1 : Compairing K observation with Lowest difference (lowest distances)
Adam with distance 1.6 with response YES
MAJORITY RESPONSE =YES
response of jack should be YES
When K=3 : Compairing K observation with Lowest difference (lowest distances)
Adam with distance 1.6 with response YES
Janet with distance 1.7 with response YES
Sarah with distance 2.4 with response YES
MAJORITY RESPONSE =YES
response of jack should be YES
When K=5 : Compairing K observation with Lowest difference (lowest distances)
Adam with distance 1.6 with response YES
Janet with distance 1.7 with response YES
Sarah with distance 2.4 with response YES
Joseph with distance 2.5 with response NO
Nancy with distance 3.7 with response NO
MAJORITY RESPONSE =YES
response of jack should be YES
RESPONSES OF COLLEN:
When K=1 : Compairing K observation with Lowest difference (lowest distances)
Tom with distance 0.9 with response NO
or
Nancy with distance 0.9 with response NO
MAJORITY RESPONSE =NO
response of collen should be YES
When K=3 : Compairing K observation with Lowest difference (lowest distances)
Tom with distance 0.9 with response No
Nancy with distance 0.9 with response No
Sarah with distance 1.2 with response YES
MAJORITY RESPONSE =NO
response of collen should be NO
When K=5 : Compairing K observation with Lowest difference (lowest distances)
Tom with distance 0.9 with response No
Nancy with distance 0.9 with response No
Sarah with distance 1.2 with response YES
Janet with distance 1.3 with response YES
Adam with distance 1.3 with response YES
MAJORITY RESPONSE =YES
response of collen should be YES
NOTE: I TRIED TO IMPLEMENT THE REQUESTED PROBLEM AS PER BEST OF MY UNDERSTANDING....IF YOU NEED ANY SORT OF HELP REGARDING THIS PROBLEM , PLEASE DO MENTION IN COMMENTS.....IF YOU GOT ANY SORT OF HELP THROUGH THIS ARTICLE PLEASE DO UPVOTE.....THANKYOU!!!