KNN Solved Example
KNN Solved Example
• 'Medium T-shirt size' is in blue color and 'Large T-shirt size' in orange color. New customer information
is exhibited in the yellow circle.
• Four blue highlighted data points, and one orange highlighted data points close the yellow circle.
• So. the prediction for the new case is a blue highlighted data point: Medium T-shirt size (for both k=3
and k=5).
kNN solved Example 2
Weight Height Class 1. Classify new observation Weight =59 and Height =170?
51 167 Underweight (k=3)
62 182 Normal Weight Height Class Distance
63 176 Normal 51 167 Underweight 8.54
65 173 Normal 62 182 Normal 12.37
63 176 Normal 7.21
68 172 Normal
65 173 Normal 6.71
55 174 Normal 68 172 Normal 9.22
52 169 Normal 55 174 Normal 5.66 3
56 173 Underweight 52 169 Normal 7.07
56 173 Underweight 2
57 170 Normal 4.24
1
57 170 Normal 2.00
61 181 Normal
61 181 Normal 11.18
• So. the prediction for the new case is: Normal (for both k=3).