Simple Algorithm
Machine Learning · Convergence · 28 min

Consistency of Nearest Neighbors

Cover and Hart’s 2× Bayes bound and Stone’s theorem.

Nearest neighbors was the first rule proved to learn every classification problem. Cover and Hart showed in 1967 that one neighbor comes within a factor of two of the Bayes error; Stone showed in 1977 that kk neighbors, with kk growing slowly, reach it for every distribution. This lesson proves both, shows that no rule can promise a rate on every problem, and maps the rates that hold under assumptions.

What you’ll learn

  • Prove that the 1-NN error converges to E[2η(X)(1−η(X))]\E[2\eta(X)(1-\eta(X))] for every distribution on Rd\R^d, and derive the MM-class Cover–Hart bound.
  • State Stone's theorem and prove it from the plug-in inequality, a variance bound and Stone's geometric lemma.
  • Prove that no classification rule converges to the Bayes error at a universal rate.
  • State the rates of k-NN under smoothness and margin conditions, and explain why the right notion of smoothness involves the marginal distribution.
  • Describe when nearest neighbors are consistent in general metric spaces, and why some interpolating neighbor rules are consistent.

Setting, and the nearest neighbor converges

Let (X,Y)(X, Y) take values in Rd×{0,1}\R^d \times \{0, 1\} with X∼μX \sim \mu, and write η(x)=P(Y=1∣X=x)\eta(x) = P(Y = 1 \mid X = x). The Bayes rule g⋆(x)=1{η(x)>12}g^\star(x) = \mathbf 1\{\eta(x) > \tfrac12\} has risk R⋆=Emin⁡{η(X),1−η(X)}R^\star = \E\min\{\eta(X), 1 - \eta(X)\}, the Bayes error. A sequence of rules gng_n, each trained on nn i.i.d. examples, is consistent for a distribution if ER(gn)→R⋆\E R(g_n) \to R^\star, and universally consistent if this holds for every distribution of (X,Y)(X, Y). Write X(i)(x)X_{(i)}(x) for the ii-th nearest sample point to xx, with distance ties broken at random.

The nearest neighbor converges. If xx lies in the support of μ\mu, every ball B(x,ε)B(x, \varepsilon) has positive mass pεp_\varepsilon, so P(∥X(1)(x)−x∥>ε)=(1−pε)n→0P\big(\norm{X_{(1)}(x) - x} > \varepsilon\big) = (1 - p_\varepsilon)^n \to 0. The support has μ\mu-measure one, hence X(1)(X)→XX_{(1)}(X) \to X in probability, and almost surely since the distance is non-increasing in nn. The same argument shows that X(k)(X)→XX_{(k)}(X) \to X whenever k/n→0k/n \to 0: the number of sample points in B(x,ε)B(x, \varepsilon) is binomial with mean npε≫knp_\varepsilon \gg k.

DerivationFrom the counting fact to the inequality
  1. E[1k∑i=1kf(X(i)(X))]=nk E[f(X1) 1{X1 is a k-NN of X}]=nk E[f(X) 1{X is a k-NN of X1}]\E\Big[\frac1k\sum_{i=1}^k f(X_{(i)}(X))\Big] = \frac nk\,\E\big[f(X_1)\,\mathbf 1\{X_1 \text{ is a } k\text{-NN of } X\}\big] = \frac nk\,\E\big[f(X)\,\mathbf 1\{X \text{ is a } k\text{-NN of } X_1\}\big]

    Write the left side as a sum over sample points, and use that X,X1,…,XnX, X_1, \dots, X_n are exchangeable to swap the roles of the query XX and the sample point X1X_1:

  2. nk E[f(X)⋅P(X is a k-NN of X1 ∣ X)]  ≤  nk⋅kγdn Ef(X)=γd Ef(X)\frac nk\,\E\Big[f(X)\cdot P\big(X \text{ is a } k\text{-NN of } X_1 \,\big|\, X\big)\Big] \;\le\; \frac nk\cdot\frac{k\gamma_d}{n}\,\E f(X) = \gamma_d\,\E f(X)

    Given XX, the counting fact says XX is among the kk nearest neighbors of at most kγdk\gamma_d of the points X1,…,XnX_1, \dots, X_n; by symmetry each is equally likely to be one of them, so the conditional probability is at most kγd/nk\gamma_d/n:

DerivationProof
  1. ∣ER(gn)−E[2η(X)(1−η(X))]∣  ≤  E ∣η(X(1)(X))−η(X)∣\Big|\E R(g_n) - \E\big[2\eta(X)(1 - \eta(X))\big]\Big| \;\le\; \E\,\big|\eta(X_{(1)}(X)) - \eta(X)\big|

    Given the sample, the labels YY and Y(1)Y_{(1)} are independent, so with η′=η(X(1)(X))\eta' = \eta(X_{(1)}(X)) the conditional error is η(1−η′)+η′(1−η)\eta(1 - \eta') + \eta'(1 - \eta). It differs from 2η(1−η)2\eta(1 - \eta) by (η′−η)(1−2η)(\eta' - \eta)(1 - 2\eta), so

  2. E∣η(X(1))−η(X)∣≤E∣(η−g)(X(1))∣⏟≤ γdε (Stone’s lemma, k=1)+E∣g(X(1))−g(X)∣⏟→ 0+E∣g(X)−η(X)∣⏟< ε\E\lvert\eta(X_{(1)}) - \eta(X)\rvert \le \underbrace{\E\lvert(\eta - g)(X_{(1)})\rvert}_{\le\,\gamma_d\varepsilon\ \text{(Stone's lemma, } k=1)} + \underbrace{\E\lvert g(X_{(1)}) - g(X)\rvert}_{\to\,0} + \underbrace{\E\lvert g(X) - \eta(X)\rvert}_{<\,\varepsilon}

    If η\eta were continuous, the right side would vanish by bounded convergence, since X(1)(X)→XX_{(1)}(X) \to X. In general, pick a continuous, compactly supported gg with E∣η(X)−g(X)∣<ε\E\lvert\eta(X) - g(X)\rvert < \varepsilon (such functions are dense in L1(μ)L^1(\mu)) and split:

  3. So the limit superior is at most (γd+1)ε(\gamma_d + 1)\varepsilon for every ε>0\varepsilon > 0. The bounds follow pointwise from 2r(1−r)≥r2r(1 - r) \ge r and Jensen's inequality, with r=min⁡(η,1−η)r = \min(\eta, 1 - \eta), as in the Descent lesson.

Many classes. With classes 1,…,M1, \dots, M and ηj(x)=P(Y=j∣x)\eta_j(x) = P(Y = j \mid x), the same argument gives R1NN=E[1−∑jηj(X)2]R_{\mathrm{1NN}} = \E\big[1 - \sum_j \eta_j(X)^2\big], the probability that two independent labels drawn at XX disagree. Let r=1−max⁡jηjr = 1 - \max_j \eta_j be the Bayes conditional error. The M−1M - 1 smaller probabilities sum to rr, so by Cauchy–Schwarz their squares sum to at least r2/(M−1)r^2/(M - 1), and

1−∑jηj2  ≤  1−(1−r)2−r2M−1  =  2r−MM−1 r2.1 - \sum_j \eta_j^2 \;\le\; 1 - (1 - r)^2 - \frac{r^2}{M-1} \;=\; 2r - \frac{M}{M-1}\,r^2 .

Taking expectations and using Er2≥(R⋆)2\E r^2 \ge (R^\star)^2 gives R⋆≤R1NN≤R⋆(2−MM−1R⋆)R^\star \le R_{\mathrm{1NN}} \le R^\star\big(2 - \tfrac{M}{M-1}R^\star\big). The lower bound holds because ∑jηj2≤max⁡jηj\sum_j \eta_j^2 \le \max_j\eta_j.

Predict before you look

A three-class problem has Bayes error R⋆=0.2R^\star = 0.2. What is the Cover–Hart upper bound on the asymptotic 1-NN error?

Show the answer

0.34

R⋆(2−MM−1R⋆)=0.2 (2−1.5×0.2)=0.2×1.7=0.34R^\star\big(2 - \tfrac{M}{M-1}R^\star\big) = 0.2\,(2 - 1.5 \times 0.2) = 0.2 \times 1.7 = 0.34. With two classes the same R⋆R^\star would give 2(0.2)(0.8)=0.322(0.2)(0.8) = 0.32: more classes leave more room for the neighbor's label to disagree.

Fixed k is not enough; Stone's theorem

For fixed odd kk, the same reasoning gives the limit RkNN=E αk(η(X))R_{k\mathrm{NN}} = \E\,\alpha_k(\eta(X)), where αk(η)\alpha_k(\eta) is the probability that a majority of kk independent Bernoulli(η)\mathrm{Bernoulli}(\eta) votes disagrees with an independent Bernoulli(η)\mathrm{Bernoulli}(\eta) label:

αk(η)=η P(Bin(k,η)<k2)+(1−η) P(Bin(k,η)>k2).\alpha_k(\eta) = \eta\,P\big(\mathrm{Bin}(k, \eta) < \tfrac k2\big) + (1 - \eta)\,P\big(\mathrm{Bin}(k, \eta) > \tfrac k2\big).

It decreases toward min⁡(η,1−η)\min(\eta, 1 - \eta) as kk grows, but for fixed kk it stays strictly above wherever 0<η<120 < \eta < \tfrac12 or 12<η<1\tfrac12 < \eta < 1. Devroye (1981) showed that, for every distribution and odd k≥5k \ge 5, RkNN≤(1+ak)R⋆R_{k\mathrm{NN}} \le (1 + a_k)R^\star with aka_k of order 1/k1/\sqrt k.

kk13571525∞\infty
αk(0.1)\alpha_k(0.1)0.1800.1220.1070.1020.1000.1000.100
αk(0.3)\alpha_k(0.3)0.4200.3860.3650.3500.3200.3070.300
The asymptotic k-NN error when η\eta is constant (labels are coin flips with bias η\eta, whatever xx is), so R⋆=min⁡(η,1−η)R^\star = \min(\eta, 1-\eta). Near-pure regions converge in a handful of neighbors; noisy regions near η=12\eta = \tfrac12 need many.
DerivationProof sketch
  1. R(gn)−R⋆=E[∣2η(X)−1∣ 1{gn(X)≠g⋆(X)}]  ≤  2 E[∣η^n(X)−η(X)∣ ∣ Dn]R(g_n) - R^\star = \E\big[\lvert 2\eta(X) - 1\rvert\,\mathbf 1\{g_n(X) \ne g^\star(X)\}\big] \;\le\; 2\,\E\big[\lvert\hat\eta_n(X) - \eta(X)\rvert \,\big|\, \data_n\big]

    Plug-in inequality. k-NN is the plug-in rule gn(x)=1{η^n(x)>12}g_n(x) = \mathbf 1\{\hat\eta_n(x) > \tfrac12\} with η^n(x)=1k∑i≤kY(i)(x)\hat\eta_n(x) = \frac1k\sum_{i \le k} Y_{(i)}(x). Where gng_n and g⋆g^\star disagree, η\eta and η^n\hat\eta_n lie on opposite sides of 12\tfrac12, so ∣2η−1∣≤2∣η^n−η∣\lvert 2\eta - 1\rvert \le 2\lvert\hat\eta_n - \eta\rvert there:

  2. E(η^n(X)−η~n(X))2=E[1k2∑i≤kη(X(i))(1−η(X(i)))]  ≤  14k  →  0\E\big(\hat\eta_n(X) - \tilde\eta_n(X)\big)^2 = \E\Big[\frac1{k^2}\sum_{i\le k}\eta(X_{(i)})\big(1 - \eta(X_{(i)})\big)\Big] \;\le\; \frac1{4k} \;\to\; 0

    Variance. Let η~n(x)=1k∑i≤kη(X(i)(x))\tilde\eta_n(x) = \frac1k\sum_{i \le k}\eta(X_{(i)}(x)). Given the inputs, the Y(i)Y_{(i)} are independent Bernoulli variables with these means, so

  3. E∣η~n(X)−η(X)∣  ≤  (γd+1) E∣η(X)−g(X)∣+E[1k∑i≤k∣g(X(i))−g(X)∣]\E\lvert\tilde\eta_n(X) - \eta(X)\rvert \;\le\; (\gamma_d + 1)\,\E\lvert\eta(X) - g(X)\rvert + \E\Big[\frac1k\sum_{i\le k}\lvert g(X_{(i)}) - g(X)\rvert\Big]

    Bias. For continuous, compactly supported gg, 1k∑i≤k∣g(X(i))−g(X)∣→0\frac1k\sum_{i \le k}\lvert g(X_{(i)}) - g(X)\rvert \to 0 because X(k)(X)→XX_{(k)}(X) \to X when k/n→0k/n \to 0. For general η\eta, approximate by such a gg in L1(μ)L^1(\mu) and transfer the error to the neighbors with Stone's lemma:

  4. Combine: E∣η^n−η∣≤1/(4k)+E∣η~n−η∣→0\E\lvert\hat\eta_n - \eta\rvert \le \sqrt{1/(4k)} + \E\lvert\tilde\eta_n - \eta\rvert \to 0, so ER(gn)→R⋆\E R(g_n) \to R^\star. Both conditions were used: k→∞k \to \infty kills the variance, k/n→0k/n \to 0 kills the bias. Nothing about the distribution was assumed, which is exactly why no rate came out.

Check your understanding

Which choice of knk_n makes the k-NN rule universally consistent on Rd\R^d?

  1. kn=5k_n = 5 for all nn
  2. kn=⌊n/2⌋k_n = \lfloor n/2 \rfloor
  3. kn=⌊n⌋k_n = \lfloor\sqrt n\rfloor
  4. kn=nk_n = n, a vote of the whole sample
Show the answer

C. kn=⌊n⌋k_n = \lfloor\sqrt n\rfloor

n→∞\sqrt n \to \infty and n/n→0\sqrt n/n \to 0, so both conditions of Stone's theorem hold. A fixed kk leaves the variance of the vote; kk proportional to nn keeps the neighborhoods from shrinking, leaving bias.

No universal rate

Stone's theorem says k-NN eventually learns anything. It is natural to ask how fast. The answer, for every rule whatsoever, is: arbitrarily slowly.

DerivationProof idea
  1. Let XX take countably many values x1,x2,…x_1, x_2, \dots with probabilities p1≥p2≥…p_1 \ge p_2 \ge \dots, and let the label be a deterministic function, Y=h(X)Y = h(X), so R⋆=0R^\star = 0. A rule has no information about h(xj)h(x_j) when xjx_j is missing from the sample, which happens with probability (1−pj)n(1 - p_j)^n.

  2. Eh ER(gn)  ≥  12∑jpj (1−pj)n\E_h\,\E R(g_n) \;\ge\; \frac12\sum_{j} p_j\,(1 - p_j)^n

    Draw the labels h(xj)h(x_j) as independent fair coins. On every unseen point, any rule is then wrong with probability 12\tfrac12, so averaged over hh,

  3. Atoms with pj≤1/np_j \le 1/n survive the factor (1−pj)n≥(1−1/n)n≥14(1 - p_j)^n \ge (1 - 1/n)^n \ge \tfrac14 (for n≥2n \ge 2), so the bound is at least an eighth of the total mass on atoms lighter than 1/n1/n. Spreading enough mass over ever smaller atoms makes this exceed ana_n for every nn. Averaging shows that for each nn some labeling is bad; a more careful choice of a single hh that is bad for all nn simultaneously completes the proof.

The lesson is the classification version of the no-free-lunch principle (No Free Lunch & Inductive Bias): any guarantee on the speed of learning must restrict the distribution. Consistency is a property of a rule; a rate is a property of a rule and a class of problems.

Think first The proof used a discrete XX. Does a continuous input, say with a smooth density on [0,1][0,1], escape the theorem?

No. A density alone does not prevent η\eta from oscillating faster and faster at finer scales: replace each atom xjx_j by a tiny interval and let the label flip between intervals. What breaks the construction is a bound on how fast η\eta can change, a smoothness assumption, which is exactly what the rates below assume.

Rates under smoothness and margin conditions

Assume (i) η\eta is Hölder with exponent β∈(0,1]\beta \in (0, 1]: ∣η(x)−η(z)∣≤L∥x−z∥β\lvert\eta(x) - \eta(z)\rvert \le L\norm{x - z}^\beta; and (ii) μ\mu has a density bounded away from zero on a regular compact support in Rd\R^d. Then the kk-th neighbor lies within distance of order (k/n)1/d(k/n)^{1/d}, so the bias term in Stone's proof is of order L(k/n)β/dL(k/n)^{\beta/d} while the variance term is at most 1/(2k)1/(2\sqrt k). Balancing them:

E∣η^n−η∣  ≲  1k+(kn)β/d⟹k≍n2β/(2β+d),ER(gn)−R⋆  ≲  n−β/(2β+d)\E\lvert\hat\eta_n - \eta\rvert \;\lesssim\; \frac1{\sqrt k} + \Big(\frac kn\Big)^{\beta/d} \quad\Longrightarrow\quad k \asymp n^{2\beta/(2\beta + d)},\qquad \E R(g_n) - R^\star \;\lesssim\; n^{-\beta/(2\beta + d)}
The plug-in inequality turns an estimation rate for η\eta into a classification rate. The exponent shrinks as dd grows: the curse of dimensionality again.

The plug-in inequality is pessimistic: errors in η^\hat\eta cost nothing where η\eta is far from 12\tfrac12. Tsybakov's margin condition with exponent α≥0\alpha \ge 0,

P(0<∣η(X)−12∣≤t)  ≤  C tαfor all t>0,P\big(0 < \lvert\eta(X) - \tfrac12\rvert \le t\big) \;\le\; C\,t^\alpha \quad \text{for all } t > 0,

says that little mass sits near the decision boundary. Under (i), (ii) and this condition, plug-in rules achieve excess risk of order n−β(1+α)/(2β+d)n^{-\beta(1+\alpha)/(2\beta + d)}, and no classifier does better uniformly over these classes (Audibert & Tsybakov, 2007). When αβ>d/2\alpha\beta > d/2 the exponent exceeds 12\tfrac12: faster than the n−1/2n^{-1/2} of agnostic learning over a fixed class.

Chaudhuri and Dasgupta (2014) showed that k-NN attains these rates, and argued that the usual assumptions, smoothness measured by radius plus a density bounded below, miss how nearest neighbors adapt to the local scale of the data. They measure smoothness by probability mass instead: the average of η\eta over a ball differs from η\eta at its center by at most a power of the ball's μ\mu-mass. That notion suits nearest neighbors, which adapt to where the data are, and it yields finite-sample bounds that also cover discrete distributions, as well as universal consistency in every metric measure space where a Lebesgue differentiation theorem holds.

AssumptionsExcess risk of k-NN with the best kkSource
none→0\to 0, at no guaranteed rateStone (1977); DGL ch. 7
η\eta β\beta-Hölder, density bounded belowO(n−β/(2β+d))\order{n^{-\beta/(2\beta+d)}}plug-in inequality, as derived above
plus margin exponent α\alphaO(n−β(1+α)/(2β+d))\order{n^{-\beta(1+\alpha)/(2\beta+d)}}, minimaxAudibert & Tsybakov (2007); Chaudhuri & Dasgupta (2014)
η\eta twice differentiable, regularity conditionsexact leading-order regret, optimal weightsSamworth (2012)
Samworth computed the leading term of the regret of every weighted nearest-neighbor classifier and found the optimal weights, which improve on the best unweighted k-NN by a dimension-dependent constant factor.
Check your understanding

Take η\eta Lipschitz (β=1\beta = 1) in d=2d = 2 dimensions. By what rate does the k-NN excess risk shrink without a margin condition, and with margin exponent α=1\alpha = 1?

  1. n−1/2n^{-1/2} without, n−1n^{-1} with
  2. n−1/4n^{-1/4} without, n−1/2n^{-1/2} with
  3. n−1/3n^{-1/3} in both cases
  4. n−1/4n^{-1/4} in both cases: the margin condition only changes constants
Show the answer

B. n−1/4n^{-1/4} without, n−1/2n^{-1/2} with

β/(2β+d)=1/4\beta/(2\beta + d) = 1/4, and with the margin condition β(1+α)/(2β+d)=2/4=1/2\beta(1 + \alpha)/(2\beta + d) = 2/4 = 1/2. Little mass near the boundary means estimation errors in η\eta rarely flip a decision.

Beyond Euclidean space, and what is open

General metric spaces. Stone's lemma is a fact about cones in Rd\R^d, and it fails in infinite dimensions. In a separable metric space, k-NN is consistent under a Besicovitch-type differentiation condition (Cérou & Guyader, 2006), which holds in finite dimension but not in every space of functions. Without such structure, k-NN and its variants are not universally consistent in every metric space. Hanneke, Kontorovich, Sabato and Weiss (2021) gave a sample-compression learner built on 1-NN that is universally strongly consistent in every essentially separable metric space, exactly the spaces in which any universally consistent learner exists.

Interpolation. The 1-NN rule fits its training set perfectly and is not consistent: its error tends to E[2η(1−η)]\E[2\eta(1-\eta)]. Yet perfect fitting is not the culprit. Belkin, Hsu and Mitra (2018) showed that weighted nearest-neighbor schemes whose weights grow without bound as the distance goes to zero interpolate the training data and are nevertheless consistent, or nearly so, with optimal rates under standard assumptions: an early, transparent example of the phenomenon studied in Benign Overfitting.

Key takeaways

  • For every distribution on Rd\R^d, the 1-NN error tends to E[2η(1−η)]\E[2\eta(1-\eta)], between R⋆R^\star and 2R⋆(1−R⋆)2R^\star(1-R^\star); with MM classes the upper bound is R⋆(2−MM−1R⋆)R^\star(2 - \frac{M}{M-1}R^\star).
  • Stone's theorem: k-NN with k→∞k \to \infty and k/n→0k/n \to 0 is universally consistent. The proof combines the plug-in inequality, a 1/(4k)1/(4k) variance bound and Stone's geometric lemma.
  • No rule has a universal rate: for any sequence an→0a_n \to 0 some distribution with R⋆=0R^\star = 0 keeps the error above ana_n. Rates need assumptions.
  • Under Hölder-β\beta smoothness, a density bounded below and margin exponent α\alpha, k-NN achieves the minimax rate n−β(1+α)/(2β+d)n^{-\beta(1+\alpha)/(2\beta+d)}; measuring smoothness by probability mass removes the density assumption.
  • In general metric spaces k-NN can fail to be consistent; a compression-based 1-NN learner is consistent wherever any learner can be, and suitably weighted interpolating neighbor rules can be consistent.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In the proof of Stone's theorem, what does each condition on kk control?

  1. k→∞k \to \infty controls the bias; k/n→0k/n \to 0 controls the variance
  2. k→∞k \to \infty controls the variance of the vote; k/n→0k/n \to 0 makes the neighborhoods shrink, controlling the bias
  3. Both control the computational cost
  4. They ensure the distribution has a density
Show the answer

B. k→∞k \to \infty controls the variance of the vote; k/n→0k/n \to 0 makes the neighborhoods shrink, controlling the bias

The variance of the vote is at most 1/(4k)1/(4k), which vanishes as k→∞k \to \infty. The bias vanishes because the kk-th neighbor converges to the query when k/n→0k/n \to 0, so the averaged η\eta values approach η(x)\eta(x).

Question 2

Labels are independent of the inputs, with P(Y=1)=0.3P(Y = 1) = 0.3 everywhere. What is the asymptotic error of the 1-NN rule?

  1. 0.30
  2. 0.21
  3. 0.42
  4. 0.60
Show the answer

C. 0.42

R1NN=E[2η(1−η)]=2(0.3)(0.7)=0.42R_{\mathrm{1NN}} = \E[2\eta(1-\eta)] = 2(0.3)(0.7) = 0.42, while R⋆=0.3R^\star = 0.3. Here r(x)r(x) is constant, so Jensen's inequality is an equality and the Cover–Hart upper bound 2R⋆(1−R⋆)2R^\star(1-R^\star) is attained.

Question 3

What does the slow-rates theorem imply for a practitioner who wants a guarantee like "error within 1% of the Bayes error after 10610^6 examples"?

  1. Such a guarantee holds for k-NN with k=nk = \sqrt n, since it is universally consistent
  2. Such a guarantee is impossible for any rule, under any assumptions
  3. It requires a deterministic labeling, so R⋆=0R^\star = 0
  4. It can hold only for a restricted class of distributions, for example under smoothness and margin conditions
Show the answer

D. It can hold only for a restricted class of distributions, for example under smoothness and margin conditions

For every rule there are distributions on which convergence is slower than any prescribed sequence, even with R⋆=0R^\star = 0. Guarantees on speed must therefore assume something, such as Hölder smoothness of η\eta and a margin condition, and they hold only for distributions satisfying it.

Question 4

Why can't the proof of Stone's theorem be copied verbatim to an infinite-dimensional space of functions?

  1. Its key geometric fact, that a point is a kk-nearest neighbor of at most kγdk\gamma_d others, relies on covering Rd\R^d with finitely many cones, which fails in infinite dimensions
  2. Distances cannot be computed between functions
  3. The Bayes error is undefined in infinite dimensions
  4. Infinite-dimensional spaces have no probability measures
Show the answer

A. Its key geometric fact, that a point is a kk-nearest neighbor of at most kγdk\gamma_d others, relies on covering Rd\R^d with finitely many cones, which fails in infinite dimensions

Stone's lemma needs the finite cone-covering number γd\gamma_d, which grows exponentially with dd and is infinite in infinite dimensions. Consistency then needs a substitute, such as a Besicovitch-type differentiation property, or a different learner altogether, as in Hanneke et al.'s compression-based rule.

Further reading

  • T. M. Cover & P. E. Hart, "Nearest neighbor pattern classification," IEEE Transactions on Information Theory 13(1), 21–27 (1967).
  • C. J. Stone, "Consistent nonparametric regression," Annals of Statistics 5(4), 595–620 (1977).
  • L. Devroye, L. Györfi & G. Lugosi, A Probabilistic Theory of Pattern Recognition (Springer, 1996), chapters 5–7 and 11.
  • K. Chaudhuri & S. Dasgupta, "Rates of convergence for nearest neighbor classification," Advances in Neural Information Processing Systems 27 (2014).
  • S. Hanneke, A. Kontorovich, S. Sabato & R. Weiss, "Universal Bayes consistency in metric spaces," Annals of Statistics 49(4), 2129–2150 (2021).