Boundaries & Margins
k-NN: Learning by Looking Around
7 min+65 XPStep 1/10
The lazy learner
k-nearest neighbors doesn't learn anything at training time — it just memorizes the dataset. To classify a new point, it finds the k closest training examples and takes a majority vote.
The decision boundary isn't drawn anywhere; it emerges from the neighborhoods. k = 1 gives jagged borders that trace every training point. Larger k smooths the vote into calmer shapes.
analogy
k-NN is asking the neighbors what neighborhood you're in. Ask one and you inherit their quirks; ask fifteen and you get the consensus of the street.