Skip to content

k-nearest neighbours

learning

Level 1 of 3

Also called k-NN and Nearest neighbour classification.

fresh numbers

The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from k-nearest neighbours's own run on the numbers shown.

choose one

question 1

A new point at 5 across, 1 up, among 4 6 c, 8 7 t, 6 7 c, 6 9 s, 3 3 c, 1 8 s, 1 5 c and 0 5 s, with k = 4. How many distances are measured?

0510-50510
the answer, and why

the answer is D

One for each of the 8 points, before any vote.

if you chose another

  • That counts only the 4 that vote.
  • That counts every step of the run, the start, the ring, the vote and the verdict too.
  • That is the nearest point alone; it is found only after all 8 are measured.

new numbersthe test page's numbers

question 2

A new point at 3 across, 3 up, among 1 10 t, 5 3 t, 0 2 s, 8 6 c, 10 9 t, 2 2 c, 5 4 s and 6 0 s, with k = 7. How many circles are inside the ring?

-50510-50510
the answer, and why

the answer is D

The ring of the 7 nearest reaches 7.28 and takes in both circles, at 2, 2 and 8, 6, 1.41 and 5.83 away.

if you chose another

  • There are only 2 circles among the points.
  • That leaves out the circle at 8, 6.
  • The nearest point is a circle.

new numbersthe test page's numbers

question 3

A new point at 9 across, 4 up, among 3 0 c, 0 5 c, 6 8 t, 4 8 s, 7 0 c and 10 8 t, with k = 3. How far does the ring reach?

05100510
the answer, and why

the answer is C

It just reaches the farthest of the 3 nearest, the triangle at 6, 8: 3 squared plus 4 squared is 25, and its root is about 5.

if you chose another

  • That is the second nearest, the circle at 7, 0.
  • That is the square at 4, 8, the nearest outside the ring.
  • That is the farthest point of all, the circle at 0, 5.

new numbersthe test page's numbers