Skip to content
Technical GlossaryMachine Learning

K-Nearest Neighbors Classifier

An instance-based classification method that labels a sample according to the classes of its nearest neighbors in feature space.

The K-Nearest Neighbors classifier is an intuitive method that does not explicitly build a model during training, but instead makes decisions by retaining the data in memory. A new sample is classified according to the majority class among its closest neighbors. Its simplicity and minimal assumptions are important advantages. However, high-dimensional data, scale differences, and computational cost in large datasets can limit performance.