We have K= 3 and the point P(x,y) = (1,2) that we want to classify as either a triangle or a circle using the dataset below. Which class must be assigned to our new point using KNNs?
Start by calculating the Euclidean distance between P and each of the given points.
| x | y | shape |
|---|---|---|
| 4 | 2 | triangle |
| 9 | -1 | triangle |
| 2 | 3 | circle |
| -2 | 7 | circle |