Tutorials › Statistical Learning (Graduate) › Kernel Bandwidth as a Boundary-Resolution Trade-Off

Kernel Classification Guarantees · Tutorial 780 of 989

Kernel Bandwidth as a Boundary-Resolution Trade-Off

Learn to relate Gaussian bandwidth, score variation across a decision boundary, RKHS norm, and the probability mass in a boundary layer.

Advanced 12 min read

What You'll Learn

  • Define the Gaussian kernel bandwidth and interpret its spatial scale.
  • Derive an exact RKHS norm bound for score contrasts at nearby points.
  • Calculate the norm needed to represent a prescribed contrast across a boundary.
  • Work with a Gaussian-section score whose sign changes at a specified boundary.
  • Translate a boundary-layer width into a classification-risk bound.
  • Distinguish boundary resolution from a guarantee of good calibrated scores.

Bandwidth Sets a Spatial Scale

A kernel classifier makes a prediction from the sign of a score function \(f\). Its decision boundary is where that score is zero. For a smooth kernel, the bandwidth controls how quickly scores can vary over space without using a large RKHS norm. This matters when the Bayes decision changes sharply: a broad kernel can make a narrow transition expensive, while a narrower kernel can resolve changes over a shorter distance.

We use the Gaussian kernel on \(\mathbb{R}^d\), \(k_h(x,z)=\exp(-\|x-z\|^2/(2h^2))\), where \(h>0\) is the bandwidth. The corresponding reproducing kernel Hilbert space is denoted \(\mathcal{H}_h\), with norm \(\|\cdot\|_{\mathcal{H}_h}\). The reproducing property says \(f(x)=\langle f,k_h(\cdot,x)\rangle_{\mathcal{H}_h}\) for \(f\in\mathcal{H}_h\). A kernel section \(k_h(\cdot,x)\) is a smooth function concentrated around \(x\), with spatial scale proportional to \(h\).

Definition: For two locations \(x_-\) and \(x_+\), a score contrast is \(f(x_+)-f(x_-)\). Its size measures how much the score changes across those locations. A boundary-resolution question asks whether this contrast can be achieved when the locations are close, and what RKHS norm is required.

The bandwidth does not determine classification quality by itself. The relevant quantities include both the norm of the score and where the feature distribution places probability mass. The following exact calculation makes the dependence of score variation on \(h\) precise.

A Norm Bound for Nearby Scores

For any \(x,y\in\mathbb{R}^d\), the reproducing property turns a difference in scores into an inner product with a difference of kernel sections. The norm of that section difference is available in closed form for the Gaussian kernel.

Theorem: For every \(h>0\), every \(f\in\mathcal{H}_h\), and every \(x,y\in\mathbb{R}^d\),
$$ |f(x)-f(y)| \leq \|f\|_{\mathcal{H}_h} \sqrt{2\left(1-\exp\left(-\frac{\|x-y\|^2}{2h^2}\right)\right)} \leq \|f\|_{\mathcal{H}_h}\frac{\|x-y\|}{h}. $$

Proof. Write \(k_x=k_h(\cdot,x)\) and \(k_y=k_h(\cdot,y)\). By the reproducing property and Cauchy–Schwarz,

$$ |f(x)-f(y)| =|\langle f,k_x-k_y\rangle_{\mathcal{H}_h}| \leq \|f\|_{\mathcal{H}_h}\|k_x-k_y\|_{\mathcal{H}_h}. $$

The squared norm of the section difference is

$$ \|k_x-k_y\|_{\mathcal{H}_h}^2 =k_h(x,x)+k_h(y,y)-2k_h(x,y) =2\left(1-\exp\left(-\frac{\|x-y\|^2}{2h^2}\right)\right). $$

This gives the first inequality. For \(u\geq 0\), \(1-e^{-u}\leq u\). Apply this with \(u=\|x-y\|^2/(2h^2)\); then the square root in the first bound is at most \(\|x-y\|/h\). This proves the second inequality. \(\square\)

In particular, if \(\|f\|_{\mathcal{H}_h}\leq B\), the score cannot change by more than \(B\|x-y\|/h\) between two nearby points. Equivalently, requiring a contrast of magnitude at least \(2a\) across points separated by distance \(\delta\) forces the lower bound

$$ \|f\|_{\mathcal{H}_h} \geq \frac{2a}{ \sqrt{2\left(1-\exp(-\delta^2/(2h^2))\right)} }. $$

When \(\delta\) is small relative to \(h\), the denominator is approximately \(\delta/h\), so the required norm is approximately \(2ah/\delta\). This is the precise sense in which a broad kernel makes a fixed-amplitude, rapid score change expensive. The bound is not saying that every narrow boundary requires a large norm for every bandwidth: when \(h\) is itself small relative to \(\delta\), the exact bound is close to a constant.

Worked Example: A Score Contrast Across a Prescribed Distance

Consider the one-dimensional Gaussian kernel and require \(f(\delta)=1\) and \(f(-\delta)=-1\), so the score contrast is \(2\) across a distance \(2\delta\). Set \(h=2\delta\). The theorem gives

$$ \|f\|_{\mathcal{H}_h} \geq \frac{2}{\sqrt{2(1-e^{-1/2})}} =\sqrt{\frac{2}{1-e^{-1/2}}}. $$

Since \(e^{-1/2}\approx 0.6065307\), the squared lower bound is \(2/(1-0.6065307)\approx 5.083\), and the norm lower bound is approximately \(2.25455\), or \(2.255\) to three decimal places. A norm budget below this value cannot produce the stipulated contrast across these two points with this bandwidth.

For comparison, if \(h=\delta\), the same calculation gives \(\|f\|_{\mathcal{H}_h}\geq\sqrt{2/(1-e^{-2})}\approx1.521\). The points and required scores have not changed; reducing the bandwidth makes this particular contrast less costly. These are necessary bounds, not a claim that the bound is always attained by a score satisfying additional constraints elsewhere.

An Explicit Smooth Boundary Score

A finite combination of Gaussian kernel sections provides a direct example of a smooth score with a sharp sign boundary. In one dimension, place sections at \(-h\) and \(h\) and subtract them. This construction has a zero exactly at the origin; its transition scale tracks the bandwidth.

Worked Example: A Gaussian-Section Score That Changes Sign

Let \(f_h(x)=k_h(x,h)-k_h(x,-h)\). For \(x>0\), the ratio of the two positive kernel values is

$$ \frac{k_h(x,h)}{k_h(x,-h)} =\exp\left(\frac{2x}{h}\right)>1. $$

Thus \(f_h(x)>0\) for \(x>0\), \(f_h(x)<0\) for \(x<0\), and \(f_h(0)=0\). At the two locations \(x=h\) and \(x=-h\), its values are \(1-e^{-2}\) and \(-(1-e^{-2})\), respectively. The contrast there is \(2(1-e^{-2})\approx1.7293\).

The RKHS norm follows from the inner products of the two sections:

$$ \|f_h\|_{\mathcal{H}_h}^2 =\|k_h(\cdot,h)-k_h(\cdot,-h)\|_{\mathcal{H}_h}^2 =2(1-e^{-2}), $$

so \(\|f_h\|_{\mathcal{H}_h}=\sqrt{2(1-e^{-2})}\approx1.315\). This norm does not depend on \(h\), while the two evaluation points move closer to the boundary as \(h\) decreases. The construction illustrates boundary resolution at the scale of the bandwidth; it does not imply that the score has a fixed, nonzero magnitude at every point away from the boundary as \(h\) changes.

That qualification is important. Correct signs alone do not ensure that a score is a good approximation to a target real-valued score, nor do they ensure small logistic loss. A smooth score can have the right sign but very small magnitude, and a norm calculation at two points does not control its values everywhere. In classification, one must connect score behavior to probability mass near the decision boundary.

Boundary Resolution and Classification Risk

For binary labels \(Y\in\{-1,+1\}\), a classifier induced by \(f\) predicts \(+1\) when \(f(X)\geq0\) and \(-1\) otherwise. The Bayes classifier minimizes the probability of misclassification. In a noiseless example with \(Y=\operatorname{sign}(X)\), errors can occur only where the classifier disagrees with that sign. If the disagreement is confined to a narrow band around zero, the probability mass of that band gives an immediate risk bound.

Worked Example: Boundary-Layer Probability Under a Uniform Distribution

Let \(X\) be uniform on \([-1,1]\), and let \(Y=+1\) for \(X>0\) and \(Y=-1\) for \(X<0\). The Bayes risk is zero. Suppose a classifier is correct whenever \(|X|>ch\), where \(c>0\) and \(ch\leq1\); inside the band it may be wrong. Since the density of \(X\) is \(1/2\),

$$ P(|X|\leq ch) =\int_{-ch}^{ch}\frac12\,dx =ch. $$

The classifier's excess risk is its error probability because the Bayes risk is zero. Its excess risk is therefore at most \(ch\), with equality if it misclassifies every point in the band (ignoring the probability-zero point \(X=0\)). For example, if \(c=1\) and \(h=0.1\), the band has probability \(0.1\), so a classifier correct outside it has excess risk at most \(0.1\).

This calculation isolates the distributional part of the trade-off: shrinking a boundary layer reduces its probability under this distribution. It does not establish that a fitted kernel classifier is correct outside that layer. Establishing such control requires a score approximation argument and control of estimation and regularization error.

In settings with label noise, the probability of a boundary layer alone is not enough to determine excess risk. What matters also is how likely the label is to favor one class strongly at each location. Margin conditions formalize that relationship. The bandwidth calculation supplies a geometric ingredient—how finely the score can change—while the distribution and noise determine the risk cost of errors near the boundary.

What the Trade-Off Does and Does Not Say

The exact section-difference bound yields a useful interpretation. If \(h\) is large compared with the distance over which a score must change by a fixed amount, the required RKHS norm can be large. Choosing a smaller bandwidth makes the kernel sections more localized and can make that change representable with a smaller norm. But the bandwidth alone does not specify the score's norm, the location of its zero set, or the risk of the resulting classifier.

The reverse direction also matters. At a fixed norm budget \(B\), the theorem implies that a score contrast between points separated by \(\delta\) is bounded above by \(B\sqrt{2(1-e^{-\delta^2/(2h^2)})}\). When \(\delta\ll h\), this is approximately \(B\delta/h\). A broad kernel and a small norm budget therefore limit how rapidly the score can move across a narrow region. A smaller \(h\) relaxes this particular restriction, but does not guarantee that the data support the resulting fine-scale boundary.

This tutorial concerns the representational trade-off for a fixed bandwidth. Choosing a bandwidth from data, and specifying how it should change with sample size to obtain consistency, are separate questions. Likewise, a fixed kernel can fail to represent the relevant decision rule well even when its score optimization is carried out accurately.

Common Pitfall

Common mistake: “A smaller Gaussian bandwidth always improves classification because it resolves sharper boundaries.” The correction is that a smaller bandwidth changes the set of functions that are easy to represent; it does not guarantee that the fitted score approximates the Bayes rule or that it generalizes. One must also account for norm, estimation error, label noise, and probability mass near the boundary.

A related mistake is to use the score-contrast bound as if it were an equality for every score. It is an upper bound on possible variation at a given norm, and its rearrangement is a necessary lower bound on the norm for a specified contrast. The explicit section-difference example supplies a particular score and its exact norm; it does not show that the lower bound is universally attained.

Key takeaway: Gaussian bandwidth controls the spatial scale of score variation. A broad bandwidth makes fixed-amplitude changes over very short distances costly in RKHS norm; a narrower bandwidth can resolve them more readily. Whether that finer resolution improves classification depends on how well the score is learned and how much probability lies near the Bayes boundary.

Check Your Understanding

Use the norm bound and examples above to answer the following questions.

  1. For Gaussian bandwidth \(h\), what is the exact RKHS norm of the difference between kernel sections centered at \(x\) and \(y\)?
  2. For a score with norm at most \(B\), state the simple upper bound on its score contrast between points at distance \(\delta\).
  3. In the prescribed-contrast example, why does the norm lower bound decrease when \(h\) changes from \(2\delta\) to \(\delta\)?
  4. For the uniform noiseless example, what is the probability of a boundary band \(|X|\leq ch\), provided \(ch\leq1\)?
  5. Why does a classifier's correct sign on either side of a boundary not, by itself, guarantee that its logistic loss is small?
Clinical Biostats