A k-nearest neighbours classifier (k = 3, Euclidean distance) is trained on the data below.
| Point | x | y | Class |
|---|---|---|---|
| P1 | 1 | 2 | A |
| P2 | 2 | 3 | A |
| P3 | 3 | 1 | B |
| P4 | 6 | 5 | B |
| P5 | 5 | 6 | B |
| P6 | 2 | 0 | A |
Determine the class that this classifier assigns to the new point (3, 3). Show the distances you calculate. [4]
- Uses Euclidean distance √((x2−x1)² + (y2−y1)²) (allow working shown for at least one point)(1)
- All six distances correct: P1 2.24, P2 1.00, P3 2.00, P4 3.61, P5 3.61, P6 3.16 (accept √5, √13, √10 etc.; accept squared distances 5, 1, 4, 13, 13, 10 used consistently for ranking)(1)
- Identifies the three nearest neighbours as P2 (A), P3 (B) and P1 (A)(1)
- Majority vote (2 A : 1 B) gives class A (allow follow-through from their three nearest neighbours)(1)
- Answer: Class A
- Examiner tip: Compute all distances, then pick the k smallest; do not stop when a pattern looks obvious.