Tutorials › Statistical Learning (Graduate) › Margin Conditions for Kernel Classification

Kernel Classification Guarantees · Tutorial 775 of 989

Margin Conditions for Kernel Classification

Learn how the distribution of conditional class probabilities near one half controls the effect of score errors on classification risk.

Advanced 10 min read

What You'll Learn

  • Define a margin condition through the probability mass near conditional class probability one half
  • Interpret the margin exponent and constant in discrete and continuous examples
  • Bound the mass of points where a uniformly inaccurate score can change the classification
  • Derive an excess-risk bound from an Lp score-error bound
  • Recognize why exact ties and the choice of margin convention matter

Why the Margin Near One Half Matters

In binary classification, the conditional probability \(\eta(x)=P(Y=1\mid X=x)\) determines the Bayes decision: predict class 1 when \(\eta(x)\) is above one half and class 0 when it is below. A score estimate can make mistakes near this threshold even when its numerical error is small. Far from the threshold, a larger error may be needed to change the predicted class.

A margin condition describes how much feature-distribution mass lies near the decision threshold. It does not require a particular kernel or estimation method. Rather, it quantifies how sensitive classification is to errors in a probability-scale score, and so helps translate score accuracy into classification-risk accuracy.

Definition: Let \(X\) have marginal distribution \(P_X\), let \(Y\in\{0,1\}\), and let \(\eta(x)=P(Y=1\mid X=x)\) be a measurable version of the conditional class probability. Define the conditional-probability margin \(Z=|\eta(X)-1/2|\), which lies between 0 and \(1/2\). A Tsybakov-type margin condition with exponent \(q>0\) and constant \(A<\infty\) is
$$ P_X\bigl(|\eta(X)-1/2|\le t\bigr)\le A t^q \qquad\text{for every }t>0. $$
The probability is with respect to the marginal distribution of \(X\). The exponent \(q\) describes how quickly the mass near the threshold shrinks as the neighborhood narrows; \(A\) is a fixed bound.

The condition is substantive when \(q>0\): it implies there is no positive probability mass exactly at the threshold. Indeed, for every \(t>0\), \(P(Z=0)\le P(Z\le t)\le At^q\), and letting \(t\) decrease to zero gives \(P(Z=0)=0\). A common alternative states the condition only for \(0<Z\le t\). That version allows mass at exact ties, which contributes no excess classification risk but must be treated separately when counting all disagreements.

Reading the Condition

A larger exponent means that the probability mass in a small threshold neighborhood is forced to decrease more rapidly. For example, an exponent of one gives an upper bound proportional to the width \(t\); an exponent of two gives an upper bound proportional to \(t^2\). The exponent is not necessarily unique: a distribution that has very little mass near the threshold may satisfy more than one such bound, with different constants.

The condition concerns the distribution of \(\eta(X)\), not the density of \(X\) by itself. It combines the geometry of the decision boundary, the way the conditional probability changes around that boundary, and how the covariates are distributed in those regions.

Worked Example: A Continuous Margin with Exponent One

Let \(X\) be uniform on \([0,1]\), and set \(\eta(x)=1/2+(x-1/2)/2\). Then \(\eta(x)\) ranges from \(1/4\) to \(3/4\), and \(Z=|X-1/2|/2\). Find a margin bound and use it to bound the vulnerable mass when a probability score is uniformly within \(0.02\) of \(\eta\).

For \(0<t\le 1/4\), the event \(Z\le t\) is the interval \(|X-1/2|\le 2t\), whose length is \(4t\). Since \(X\) is uniform, \(P(Z\le t)=4t\). For \(t>1/4\), \(P(Z\le t)=1\le 4t\). Thus the margin condition holds with \(q=1\) and \(A=4\).

If \(|g(X)-\eta(X)|\le 0.02\) everywhere, a threshold-based classifier using \(g\) can disagree with the Bayes classifier only where \(Z\le 0.02\). The disagreement probability is therefore at most \(4(0.02)=0.08\). The condition says that no more than eight percent of the covariate distribution can lie in the threshold neighborhood in which this error could change a prediction.

Worked Example: Checking a Discrete Margin Condition

Suppose \(X\) has three types of values. With probabilities \(0.2\), \(0.3\), and \(0.5\), respectively, let \(\eta(X)\) equal \(0.5\pm0.05\), \(0.5\pm0.25\), and \(0.5\pm0.4\). Within each type, either sign may occur. Verify a margin condition with exponent one.

For \(0<t<0.05\), \(P(Z\le t)=0\). For \(0.05\le t<0.25\), that probability is \(0.2\), and \(0.2\le4t\) because \(4t\ge0.2\). For \(0.25\le t<0.4\), it is \(0.2+0.3=0.5\), and \(0.5\le4t\) because \(4t\ge1\). Finally, for \(t\ge0.4\), it is 1, and \(1\le4t\).

Thus \(P(Z\le t)\le4t\) for every \(t>0\), so \(q=1\) and \(A=4\) work. The calculation uses the cumulative mass at each margin level: checking only the probability at the smallest margin would miss the additional mass that enters as \(t\) increases.

From Score Error to Vulnerable Mass

Let \(g:\mathcal X\to[0,1]\) be a measurable probability-scale score, and classify using \(h_g(x)=1\{g(x)\ge1/2\}\). Let \(h^*(x)=1\{\eta(x)\ge1/2\}\) be a Bayes classifier. If these rules disagree at \(x\), the score must have crossed the threshold relative to \(\eta(x)\). Consequently, \(|g(x)-\eta(x)|\ge|\eta(x)-1/2|\).

Result: If the margin condition holds with \(q>0\) and constant \(A\), and \(|g(X)-\eta(X)|\le\varepsilon\) almost surely, then for \(0\le\varepsilon\le1/2\),
$$ P\bigl(h_g(X)\ne h^*(X)\bigr)\le A\varepsilon^q. $$

Proof. On the disagreement event, the threshold-crossing inequality gives \(Z\le|g(X)-\eta(X)|\le\varepsilon\). Thus the disagreement event is contained in \(\{Z\le\varepsilon\}\). Applying the margin condition gives \(P(h_g(X)\ne h^*(X))\le P(Z\le\varepsilon)\le A\varepsilon^q\). At \(\varepsilon=0\), the same conclusion follows because the condition implies \(P(Z=0)=0\). \(\square\)

This result bounds the mass of potentially changed decisions. Classification risk gives greater weight to errors farther from the boundary, so an excess-risk bound can be sharper than a disagreement-probability bound. For a classifier \(h\), write \(R(h)=P(h(X)\ne Y)\). Conditioning on \(X=x\), predicting 0 has error probability \(\eta(x)\), while predicting 1 has error probability \(1-\eta(x)\). Choosing the worse of these two decisions incurs conditional excess error \(|2\eta(x)-1|\). Hence

$$ R(h)-R(h^*)=E\!\left[|2\eta(X)-1|\,1\{h(X)\ne h^*(X)\}\right] =2E\!\left[Z\,1\{h(X)\ne h^*(X)\}\right]. $$

The identity also shows why exact ties do not affect excess risk: when \(Z=0\), the conditional error is the same for either prediction.

Worked Example: Uniform Score Error and Excess Risk

Continue with the uniform-\(X\) model above, for which \(Z=|X-1/2|/2\) and the margin condition holds with \(A=4\), \(q=1\). Suppose \(|g(X)-\eta(X)|\le0.02\). Bound the excess risk of \(h_g\).

Disagreement is possible only when \(Z\le0.02\), or equivalently when \(|X-1/2|\le0.04\). Using the excess-risk identity and \(Z\le0.02\) on this event,

$$ R(h_g)-R(h^*) =2E[Z\,1\{h_g(X)\ne h^*(X)\}] \le 2(0.02)P(Z\le0.02) \le 2(0.02)(0.08)=0.0032. $$

The same model permits an exact calculation of the largest excess risk over classifiers that disagree only in this interval. Since \(X\) is uniform, that quantity is \(2\int_{0.46}^{0.54}|x-1/2|/2\,dx=0.0016\). The margin-based bound \(0.0032\) is valid but not exact; it replaces the margin throughout the interval by its maximum value.

A Bound from an Average Score Error

A uniform error guarantee is often unavailable. A useful alternative is to control the \(p\)th moment of the probability-score error, for some \(p\ge1\). The margin condition and a threshold argument then separate points close to the boundary from points where crossing the boundary requires a larger score error.

Theorem: Suppose \(q>0\), \(A<\infty\), the margin condition holds, \(p\ge1\), and \(M=E[|g(X)-\eta(X)|^p]<\infty\). For every \(0<t\le1/2\),
$$ R(h_g)-R(h^*)\le 2A t^{q+1}+\frac{2M}{t^{p-1}}. $$
In particular,
$$ R(h_g)-R(h^*)\le 2(A+1)M^{(q+1)/(p+q)} $$
when \(M>0\); when \(M=0\), the excess risk is zero.

Proof. Write \(e(X)=g(X)-\eta(X)\) and \(D=\{h_g(X)\ne h^*(X)\}\). As above, \(D\subseteq\{Z\le|e(X)|\}\). Split the excess-risk identity according to whether \(Z\le t\) or \(Z>t\). On the first part, \(Z\le t\), so

$$ 2E[Z1\{D,Z\le t\}] \le 2tP(0<Z\le t) \le 2A t^{q+1}. $$

The condition \(q>0\) ensures \(P(Z=0)=0\), so omitting \(Z=0\) does not change this expectation. On the second part, \(D\) implies \(|e(X)|\ge Z>t\). Therefore \(Z\le |e(X)|^p/Z^{p-1}\le |e(X)|^p/t^{p-1}\), and

$$ 2E[Z1\{D,Z>t\}] \le \frac{2E[|e(X)|^p]}{t^{p-1}} =\frac{2M}{t^{p-1}}. $$

Adding the two bounds proves the inequality for every \(0<t\le1/2\). For \(M>0\), choose \(t=M^{1/(p+q)}\) when this is at most \(1/2\). Both terms then have the power \(M^{(q+1)/(p+q)}\), giving the stated bound. If \(M^{1/(p+q)}>1/2\), the right-hand side \(2(A+1)M^{(q+1)/(p+q)}\) is at least 1, while excess risk is at most 1. If \(M=0\), then \(g(X)=\eta(X)\) almost surely, so the induced classifier is Bayes-optimal almost surely. \(\square\)

Worked Example: An L2 Score-Error Bound

Suppose the margin condition has \(A=4\), \(q=1\), and a fitted probability score satisfies \(E[|g(X)-\eta(X)|^2]=0.0001\). Use the theorem with \(p=2\) to obtain an excess-risk bound.

Here \(M=0.0001\), and the balancing threshold is \(t=M^{1/(p+q)}=0.0001^{1/3}\), approximately \(0.0464\), which is below \(1/2\). Substitution into the two-term bound gives

$$ R(h_g)-R(h^*)\le 2(4)(0.0464)^2+\frac{2(0.0001)}{0.0464} \approx 0.0172+0.0043=0.0215. $$

Equivalently, the simplified theorem bound is \(2(4+1)(0.0001)^{2/3}\approx0.0215\). This is a guarantee, not a prediction that the actual excess risk equals that value. The bound uses only the score-error moment and the margin condition, rather than details of how the score was estimated.

Common Pitfall and Practical Meaning

Common mistake: “The score error is small on average, so few classifications can be wrong.” This reasoning ignores where the score errors occur. Even tiny errors can change many decisions if much of the covariate distribution has conditional probabilities close to one half. Conversely, a less accurate score can still classify well when little probability mass lies near the threshold.

The margin condition supplies the missing distributional information. Under a uniform error bound, it directly limits the mass of points whose decisions are vulnerable. Under an \(L^p\) error bound, the derived result shows how that limited near-boundary mass combines with the probability of larger errors. The resulting guarantee is about classification excess risk, not about whether the estimated score is uniformly close to the true conditional probability.

The condition is an assumption about the data distribution, not a property automatically guaranteed by a kernel choice. Its exponent and constant describe the difficulty of classification near the Bayes boundary. They can clarify why two settings with similar score errors may have different classification performance, while remaining distinct from assumptions that directly control the variance of a loss or score.

Check Your Understanding

Use the definitions and arguments above to answer the following questions.

  1. In the margin condition, what feature of the distribution does the exponent \(q\) describe?
  2. Why does a margin condition with \(q>0\) and \(P(Z\le t)\le At^q\) rule out positive probability at \(Z=0\)?
  3. If a probability score is uniformly within \(\varepsilon\) of \(\eta\), why can disagreement with the Bayes classifier occur only when \(Z\le\varepsilon\)?
  4. In the \(L^p\) excess-risk proof, why is it useful to split the expectation at a threshold \(t\)?
  5. How does the conclusion change if the margin condition is imposed only on \(0<Z\le t\) and there is positive mass at exact ties?
Clinical Biostats