Skip to main content

Envisioning is an emerging technology research institute and advisory.

LinkedInInstagramGitHub

2011 — 2026

research
  • Observatory
  • Newsletter
  • Methodology
  • Origins
  • Vocab
services
  • Signals Session
  • Bespoke Projects
  • Build Sessions
  • Use Cases
  • Readinessfree
  • Signals
  • Free scan↗free
impact
  • ANBIMAFuture of Brazilian Capital Markets
  • IEEECharting the Energy Transition
  • Horizon 2045Future of Human and Planetary Security
  • WKOTechnology Scanning for Austria
solutions
  • Innovation
  • Strategy
  • Consultants
  • Foresight
  • Associations
  • Governments
resources
  • Partners
  • Coding for Non-Coders
  • How We Work
  • Data Visualization
  • Multi-Model Method
  • FAQ
  • Security & Privacy
about
  • Manifesto
  • Community
  • Events
  • Support
  • Contact
ResearchServicesSignalsAbout
ResearchServicesSignalsAbout
  1. Home
  2. Vocab
  3. kNN (k-Nearest Neighbors)

kNN (k-Nearest Neighbors)

A non-parametric algorithm that classifies points by majority vote of their nearest neighbors.

Year: 1967Generality: 796
Back to Vocab

k-Nearest Neighbors (kNN) is one of the most intuitive algorithms in machine learning, operating on a deceptively simple principle: to classify or predict a value for a new data point, find the k most similar examples in the training set and let them vote. In classification tasks, the new point inherits the majority class among its k neighbors; in regression, it receives the average of their output values. The algorithm is entirely non-parametric, meaning it makes no assumptions about the underlying data distribution — the training data itself serves as the model.

The mechanics of kNN hinge on two key choices: the value of k and the distance metric used to define "nearness." Common metrics include Euclidean distance (straight-line distance in feature space), Manhattan distance (sum of absolute differences), and Hamming distance (useful for categorical data). A small k makes the model sensitive to noise and prone to overfitting, while a large k smooths decision boundaries but risks underfitting. Selecting the right k typically involves cross-validation. Because kNN stores the entire training dataset and defers all computation to query time, it is classified as a lazy learner — there is no explicit training phase, but prediction can be slow and memory-intensive for large datasets.

Despite its simplicity, kNN remains practically relevant and theoretically important. It is often used as a baseline model, for anomaly detection, and in recommendation systems. Its performance degrades in high-dimensional spaces — a phenomenon known as the curse of dimensionality — where distances between points become increasingly uniform, making "nearness" meaningless. Dimensionality reduction techniques like PCA are frequently applied as preprocessing steps to mitigate this.

kNN also serves as a conceptual anchor for understanding more sophisticated algorithms. Its decision boundaries are inherently local and non-linear, offering a useful contrast to linear models. Approximate nearest neighbor methods (e.g., KD-trees, ball trees, FAISS) have extended kNN's scalability, keeping it relevant even as dataset sizes have grown dramatically in the modern deep learning era.

Research this in Signals

Scan kNN (k-Nearest Neighbors) for yourself.

Signals turns a topic into a sourced research record you can inspect and rerun. Your first scan is free, and this one starts with kNN (k-Nearest Neighbors) already loaded, so edit it or scan as is.