# k-Nearest Neighbour Classifiers: 2nd Edition (with Python examples)

arXiv: https://arxiv.org/abs/2004.04523 · HTML: https://mlsanity.com/paper/2004.04523/

## Key facts

- Cited by 56 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 9 Apr 2020.

## Built on by (most cited first, 30 of 56)

- [A unified logical framework for explanations in classifier systems](https://mlsanity.com/paper/2105.14452/) (2021)
- [Large Language Models as Batteries-Included Zero-Shot ESCO Skills Matchers](https://mlsanity.com/paper/2307.03539/) (2023)
- [Ten Years of Generative Adversarial Nets (GANs): A survey of the state-of-the-art](https://mlsanity.com/paper/2308.16316/) (2023)
- [GyroFlow+: Gyroscope-Guided Unsupervised Deep Homography and Optical Flow Learning](https://mlsanity.com/paper/2301.10018/) (2023)
- [Task-Driven Causal Feature Distillation: Towards Trustworthy Risk Prediction](https://mlsanity.com/paper/2312.16113/) (2023)
- [Global Proxy-based Hard Mining for Visual Place Recognition](https://mlsanity.com/paper/2302.14217/) (2023)
- [Integrating kNN with Foundation Models for Adaptable and Privacy-Aware Image Classification](https://mlsanity.com/paper/2402.12500/) (2024)
- [Combining Varied Learners for Binary Classification using Stacked Generalization](https://mlsanity.com/paper/2202.08910/) (2022)
- [BudgetLeak: Membership Inference Attacks on RAG Systems via the Generation Budget Side Channel](https://mlsanity.com/paper/2511.12043/) (2025)
- [Detection of Tool based Edited Images from Error Level Analysis and Convolutional Neural Network](https://mlsanity.com/paper/2204.09075/) (2022)
- [LOSS-GAT: Label Propagation and One-Class Semi-Supervised Graph Attention Network for Fake News Detection](https://mlsanity.com/paper/2402.08401/) (2024)
- [Sources of Gain: Decomposing Performance in Conditional Average Dose Response Estimation](https://mlsanity.com/paper/2406.08206/) (2024)
- [CAVE-Net: Classifying Abnormalities in Video Capsule Endoscopy](https://mlsanity.com/paper/2410.20231/) (2024)
- [CodingHomo: Bootstrapping Deep Homography With Video Coding](https://mlsanity.com/paper/2504.12165/) (2025)
- [DINO-MX: A Modular & Flexible Framework for Self-Supervised Learning](https://mlsanity.com/paper/2511.01610/) (2025)
- [Vital Node Identification in Complex Networks Using a Machine Learning-Based Approach](https://mlsanity.com/paper/2202.06229/) (2022)
- [A k nearest neighbours classifiers ensemble based on extended neighbourhood rule and features subsets](https://mlsanity.com/paper/2205.15111/) (2022)
- [A unified weighting framework for evaluating nearest neighbour classification](https://mlsanity.com/paper/2311.16872/) (2023)
- [DoDo-Code: an Efficient Levenshtein Distance Embedding-based Code for 4-ary IDS Channel](https://mlsanity.com/paper/2312.12717/) (2023)
- [Optimizing Ego Vehicle Trajectory Prediction: The Graph Enhancement Approach](https://mlsanity.com/paper/2312.13104/) (2023)
- [Hyper-STTN: Hypergraph Augmented Spatial-Temporal Transformer Network for Trajectory Prediction](https://mlsanity.com/paper/2401.06344/) (2024)
- [Machine learning and natural language processing models to predict the extent of food processing](https://mlsanity.com/paper/2412.17217/) (2024)
- [Detecting and Mitigating DDoS Attacks with AI: A Survey](https://mlsanity.com/paper/2503.17867/) (2025)
- [From Data to Decision: A Multi-Stage Framework for Class Imbalance Mitigation in Optical Network Failure Analysis](https://mlsanity.com/paper/2509.00057/) (2025)
- [A Comparison of Selected Image Transformation Techniques for Malware Classification](https://mlsanity.com/paper/2509.10838/) (2025)
- [A Perception CNN for Facial Expression Recognition](https://mlsanity.com/paper/2512.06422/) (2025)
- [Reasoning through Verifiable Forecast Actions: Consistency-Grounded RL for Financial LLMs](https://mlsanity.com/paper/2605.21975/) (2026)
- [An Automated Data Engineering Pipeline for Anomaly Detection of IoT Sensor Data](https://mlsanity.com/paper/2109.13828/) (2021)
- [Sub-Setting Algorithm for Training Data Selection in Pattern Recognition](https://mlsanity.com/paper/2110.06527/) (2021)
- [Performance Comparison of Simple Transformer and Res-CNN-BiLSTM for Cyberbullying Classification](https://mlsanity.com/paper/2206.02206/) (2022)

## Abstract (arXiv)

Perhaps the most straightforward classifier in the arsenal or machine learning techniques is the Nearest Neighbour Classifier -- classification is achieved by identifying the nearest neighbours to a query example and using those neighbours to determine the class of the query. This approach to classification is of particular importance because issues of poor run-time performance is not such a problem these days with the computational power that is available. This paper presents an overview of techniques for Nearest Neighbour classification focusing on; mechanisms for assessing similarity (distance), computational issues in identifying nearest neighbours and mechanisms for reducing the dimension of the data. This paper is the second edition of a paper previously published as a technical report. Sections on similarity measures for time-series, retrieval speed-up and intrinsic dimensionality have been added. An Appendix is included providing access to Python code for the key methods.
