Abstract
We derive a new asymptotic expansion for the global excess risk of a local-$k$-nearest neighbour classifier, where the choice of $k$ may depend upon the test point. This expansion elucidates conditions under which the dominant contribution to the excess risk comes from the decision boundary of the optimal Bayes classifier, but we also show that if these conditions are not satisfied, then the dominant contribution may arise from the tails of the marginal distribution of the features. Moreover, we prove that, provided the $d$-dimensional marginal distribution of the features has a finite $\rho$th moment for some $\rho > 4$, a local choice of $k$ can yield a rate of convergence of the excess risk of $O(n^{-4/(d+4)})$, where $n$ is the sample size. In contrast, standard $k$-nearest neighbour classifiers require $d \geq 5$ and $\rho > 4d/(d-4)$ finite moments to achieve this rate. These results motivate a new $k$-nearest neighbour classifier for semi-supervised learning problems, where unlabelled data are used to estimate the marginal feature density, allowing for fewer neighbours when this density estimate is small. Our worst-case rates are complemented by a minimax lower bound, revealing that the local, semi-supervised $k$-nearest neighbour classifier attains the minimax optimal rate over our classes for the excess risk, up to a subpolynomial factor in $n$.
Introduction
The $k$-nearest neighbour (kNN) algorithm is a cornerstone of non-parametric statistics. However, its theoretical performance is often analyzed under restrictive conditions, such as assuming data resides within a compact support or focusing exclusively on the decision boundary. In practice, many datasets exhibit "heavy tails" where data points are sparse but still present far from the distribution's center.
Standard kNN classifiers utilize a single, global $k$ for every prediction. This paper identifies a fundamental flaw in this approach: a $k$ optimized for the dense "body" of a distribution is often too large for its sparse "tails," leading to high bias. Conversely, a $k$ suited for the tails may be too small for the body, leading to high variance. The authors propose a "local" kNN (LkNN) that adapts $k$ based on the local feature density, leveraging unlabeled data to optimize this choice.
Methodology
The Local $k$ Approach
The core innovation is the transition from a constant $k$ to a function $k(x)$, where the number of neighbours depends on the specific test point $x$. The authors derive a new asymptotic expansion for the global excess risk (the error beyond the optimal Bayes classifier), which reveals that error contributions arise from both the decision boundary and the distribution tails.
Semi-Supervised Learning Integration
Since the true underlying density of features is typically unknown, the authors implement a semi-supervised learning (SSL) framework:
- Density Estimation: A large set of unlabeled data is used to estimate the marginal feature density via a Kernel Density Estimator (KDE).
- Local Selection: This density estimate is used to calculate the optimal local $k(x)$. In low-density regions (the tails), the algorithm selects fewer neighbours to prevent the neighbourhood from stretching into regions with different class probabilities.
- Classification: The LkNN then performs classification using the tailored $k(x)$ for each query.
Theoretical Contributions
Convergence Rates
The paper proves that LkNN achieves a convergence rate of $O(n^{-4/(d+4)})$ for excess risk under significantly broader conditions than standard kNN. While standard kNN requires at least five dimensions ($d \geq 5$) and specific tail properties to reach this rate, LkNN achieves it in any dimension, provided the distribution has at least four finite moments.
Minimax Optimality
The authors establish a minimax lower bound, demonstrating that no classifier can fundamentally outperform the rates achieved by LkNN for the distribution classes studied, confirming the method's theoretical efficiency.
Empirical Validation
The theoretical findings were tested through a simulation study involving three distinct feature distributions:
- Gaussian: A standard light-tailed scenario.
- Student’s $t_5$: A heavy-tailed scenario.
- Cauchy: An extremely heavy-tailed scenario where mean and variance are undefined.
In these simulations, the Semi-Supervised LkNN consistently outperformed the standard global kNN. Notably, the LkNN's performance was nearly identical to an "Oracle" version (which uses the true density), proving that the KDE step effectively utilizes unlabeled data to solve the tail problem.
Discussion and Limitations
While LkNN offers superior theoretical and empirical performance in the presence of heavy tails, it introduces new considerations:
- Computational Cost: Calculating a KDE estimate for every test point adds overhead compared to standard kNN.
- Curse of Dimensionality: KDE itself becomes less efficient in very high dimensions, which may require significantly more unlabeled data to maintain accuracy.
- Parameter Tuning: The method introduces additional hyperparameters, such as the KDE bandwidth, which require careful calibration.
Conclusion
By adapting the number of neighbours to the local density of the data, the LkNN classifier provides a more robust and theoretically optimal approach to non-parametric classification. The integration of unlabeled data through semi-supervised learning offers a practical pathway to improving kNN performance in real-world scenarios where data distributions are not well-behaved.
Summary updated