Skip to content

k-nearest neighbours

learning

Level 1 of 3

Also called k-NN and Nearest neighbour classification.

To give a new point a class, measure how far every point is from it, take the k nearest, and give the new point the class more of them hold than any other.

distances measured
0

step 1 of 1

Examples

Points as two whole numbers from 0 to 10 and a letter for the class (t triangle, s square, c circle), 3 to 12 of them, then the new point, then k. For example: 2 8 t, 7 8 s, 8 6 s, 7 2 c; 5 5; 3