Evolutionary Adaptive Neighborhood Learning: A Genetic Algorithm for Instance-Dependent k Optimization in Nearest Neighbor Classification
Abstract
The number of neighbours k is the central hyperparameter of the k-nearest neighbour (k-NN) classifier and is usually selected globally through cross-validation or evolutionary search. However, the bias-variance trade-off is inherently local: dense and noise-free regions may favour small neighbourhoods, whereas sparse or noisy regions may require larger ones. Since global-k optimization is one-dimensional, replacing exhaustive search with a genetic algorithm offers little computational advantage. We therefore optimize an instance-dependent neighbourhood policy instead. We propose EANK (Evolutionary Adaptive Neighborhood K), which uses a low-dimensional policy to map local neighbourhood descriptors, including density, label entropy, vote margin, and concentration, to an adaptive number of neighbours k(x). A real-coded elitist genetic algorithm optimizes this policy using leave-one-out accuracy with a neighbourhood-smoothness penalty. Precomputed neighbour votes reduce fitness evaluation costs. We investigate theoretical properties of the method, including dominance over global-k solutions on the training criterion, evolutionary convergence, policy regularity, and generalization guarantees. Experiments on synthetic data with spatially heterogeneous structure and twelve public datasets evaluate predictive performance, robustness, and computational cost. Under nested cross-validation, EANK achieves competitive performance relative to tuned global-k baselines and improves upon the default k=5. We also examine the gap between training and test performance to assess the practical value of adaptive neighbourhood selection.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI
Related papers
Evolutionary Adaptive Metric Learning: A Multi-Objective Framework for Learning Local Distance Functions in Nearest Neighbor Classification
Shared title terminologycs.LGIsaac Touza
CARROT: Competitive Adaptive Graph Clustering via Semi-Relaxed Optimal Transport
Shared title terminologycs.LGChing Fan Chiang, Jia-Yu Pan, Wen-Chieh Lin
ResQAdam: Residual-Preserving Adaptive Optimization for Memory-Efficient Quantization Aware Training
Shared title terminologycs.LGLiqun Ma, Shengkun Tang, Liangyu Wang et al.
Text-Conditioned Low-Rank Adaptation of Time-Series Foundation Models for Multimodal Forecasting
Shared title terminologycs.LGKunqi Li, Bin Liang, Zhidong Li
When High Capacity Becomes Undeployable: Pore-Filling Constraints for Multi-Objective Optimization of Direct Air Capture Sorbents
Shared title terminologycs.LGYujie Liu, Xuehua Shen, Zuotai Zhang
Feature Engineered Reinforcement Learning for S-pair Selection in Buchberger's Algorithm
Shared title terminologycs.LGUzma Shafiq, Matthew England, Nayyar Zaidi