KNN

Also known as · K-Nearest Neighbours

K-nearest neighbours classifies a point by a majority vote among its KK closest training points, using Euclidean Distance. There is no training step, but prediction is slow.

When to use

Always scale features first. A very small KK overfits and a very large KK underfits; the rule of thumb is K≈nK \approx \sqrt{n}, odd to avoid ties. It degrades in many dimensions (Curse of Dimensionality).

See DS Lec 3.

Appears in