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 4 across, 1 up, among 9 10 s, 2 6 s, 1 9 c, 3 2 s and 2 7 t, with k = 3. How many distances are measured?

0510-50510
the answer, and why

the answer is B

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

if you chose another

  • That counts only the 3 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 5 are measured.

new numbersthe test page's numbers

question 2

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

-50510051015
the answer, and why

the answer is B

The ring of the 3 nearest reaches 8.06 and takes in both circles, at 0, 4 and 0, 0, 2 and 6 away.

if you chose another

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

new numbersthe test page's numbers

question 3

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

05100510
the answer, and why

the answer is D

It just reaches the farthest of the 3 nearest, the square at 5, 9: 4 squared plus 2 squared is 20, and its root is about 4.47.

if you chose another

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

new numbersthe test page's numbers