the.ai

Foundations / Instance-Based

verified

k-Nearest Neighbors

To classify something, find the most similar examples already seen and let them vote. There is no training step at all — the data is the model. It is the baseline every other method ought to have to beat, and on small, low-dimensional problems it is embarrassingly hard to beat.

Viz primitive · budget-splitk = 5

k holds 1% of the budget; rest holds the remaining 99%.

Stored examples one prediction consults against those it ignores. Drag k to watch the vote widen and the boundary blur.

5

Reviewed by opendroid · 2026-08-13

  • arXiv:1603.09320 — Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs

Origin · not linkable

  • Cover & Hart 1967 — Nearest Neighbor Pattern Classification · IEEE Transactions on Information Theory 13(1) · doi:10.1109/TIT.1967.1053964
  • Beyer et al. 1999 — When Is “Nearest Neighbor” Meaningful? · ICDT 1999 · doi:10.1007/3-540-49257-7_15