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

05100510
the answer, and why

the answer is C

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

if you chose another

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

new numbersthe test page's numbers

question 2

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

0510-50510
the answer, and why

the answer is B

The ring of the 4 nearest reaches 5.1 and takes in both circles, at 1, 1 and 3, 6, 1 and 5.1 away.

if you chose another

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

new numbersthe test page's numbers

question 3

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

02468100246810
the answer, and why

the answer is A

It just reaches the farthest of the 3 nearest, the triangle at 2, 6: 4 squared plus 0 squared is 16, and its root is about 4.

if you chose another

  • That is the second nearest, the triangle at 3, 5.
  • That is the circle at 1, 5, the nearest outside the ring.
  • That is the farthest point of all, the circle at 0, 10.

new numbersthe test page's numbers