Tutorials › Statistical Learning (Graduate) › Common Errors in Kernel Classification Guarantees

Kernel Classification Guarantees · Tutorial 788 of 989

Common Errors in Kernel Classification Guarantees

Learn to diagnose four common errors that can turn a valid kernel-classification guarantee into an incorrect conclusion.

Advanced 11 min read

What You'll Learn

  • Distinguish the numerical value of a surrogate risk from zero-one classification risk.
  • Define a score-based classifier at zero and calculate how tie handling changes its risk.
  • Explain why zero training error or separability alone does not guarantee fast generalization.
  • Convert a regularization parameter correctly when an objective changes from a sum to an average.
  • Check which assumptions a kernel classification rate actually uses.

Why Guarantee Audits Need More Than a Rate Formula

A kernel classification guarantee is a chain of statements: an objective is minimized, the resulting score is turned into a classifier, and the classifier's population risk is bounded. Errors arise when one link is silently replaced by another. A small surrogate loss is not itself a zero-one risk; a score of zero needs a prediction rule; separability is not a generalization bound; and a penalty parameter has meaning only relative to the objective's normalization.

The earlier material on margin conditions, fast rates, and regularization scaling supplies the ingredients for many such bounds. Here the task is to audit how those ingredients are used. We use binary labels \(Y\in\{-1,+1\}\), an input \(X\), and a measurable real-valued score \(f\). Unless stated otherwise, define its classifier by \(g_f(x)=+1\) when \(f(x)\geq 0\), and \(g_f(x)=-1\) when \(f(x)<0\). This convention matters when the score is tied at zero.

Definition: The zero-one risk of a classifier \(g\) is \(R_{01}(g)=P(g(X)\ne Y)\). For a nonnegative margin loss \(\phi:\mathbb{R}\to[0,\infty)\), the surrogate risk of a score \(f\) is \(R_\phi(f)=E[\phi(Yf(X))]\), when this expectation exists. These are different quantities: the first evaluates predicted labels, while the second evaluates margins through a chosen loss function.

Error 1: Calling Surrogate Risk Zero-One Risk

A surrogate loss replaces the discontinuous error indicator with a loss on the signed score \(Yf(X)\). For example, the hinge loss is \(\phi_{\mathrm{hinge}}(u)=(1-u)_+\), where \(a_+=\max(a,0)\). The logistic loss is \(\phi_{\mathrm{log}}(u)=\log(1+e^{-u})\). Their values and scales are not those of the zero-one loss. A numerical surrogate-risk bound must not be reported as though it were a bound of the same numerical size on classification error unless a valid comparison has been established.

Proposition: For the stated tie convention, every measurable score \(f\) satisfies \(R_{01}(g_f)\leq R_{\mathrm{hinge}}(f)\). In particular, if \(R_{\mathrm{hinge}}(f)=0\), then \(R_{01}(g_f)=0\). This inequality does not say that the two risks are equal.

Proof. For each outcome \((X,Y)\), if \(g_f(X)\ne Y\), then \(Yf(X)\leq 0\). Indeed, an error with \(Y=+1\) requires \(f(X)<0\), while an error with \(Y=-1\) under the chosen convention requires \(f(X)\geq 0\); in both cases the signed margin is at most zero. Therefore \((1-Yf(X))_+\geq 1\). If there is no error, the indicator of error is zero and the hinge loss is nonnegative. Thus, pointwise,

$$ \mathbf{1}\{g_f(X)\ne Y\}\leq (1-Yf(X))_+. $$

Taking expectations gives the asserted risk inequality. If the hinge risk is zero, the nonnegative zero-one risk is bounded above by zero and hence is zero. \(\square\)

Worked Example: Perfect Classification With Positive Logistic Risk

Suppose \(X\) is constant and \(Y=+1\) with probability one. Let the score be \(f(X)=2\). The classifier predicts \(+1\) every time, so \(R_{01}(g_f)=0\). Its logistic risk, however, is

$$ R_{\mathrm{log}}(f)=\log(1+e^{-2})\approx 0.1269. $$

The positive value is not a classification error. It is the logistic loss assigned to a finite positive margin. Increasing the score would lower this loss, but the predicted label would remain unchanged. Thus a reader must not interpret logistic risk as the probability of misclassification.

The reverse shortcut is also unsafe: a small surrogate risk does not, by itself, identify a particular zero-one risk. The hinge inequality above is a valid one-sided comparison for the raw hinge risk. To reason about excess risk, one must compare the appropriate excess quantities and use a valid surrogate-to-classification-risk result under its hypotheses. In general, subtracting a surrogate-risk infimum does not turn the difference into zero-one excess risk.

Worked Example: A Zero Score and Two Different Risk Statements

Again let \(X\) be constant, but now let \(P(Y=+1)=P(Y=-1)=1/2\), and set \(f(X)=0\). Under our convention, \(g_f(X)=+1\), so \(R_{01}(g_f)=1/2\). The logistic risk is

$$ R_{\mathrm{log}}(f) =\frac12\log(1+e^0)+\frac12\log(1+e^0) =\log 2\approx 0.6931. $$

The two numbers answer different questions: one is a probability of label error, and the other is an expected loss on the score. In particular, \(0.6931\) is not the classifier's error probability.

Error 2: Leaving Score Ties Unspecified

The notation \(\operatorname{sign}(f(x))\) can conceal a genuine decision rule. At \(f(x)=0\), a convention is needed: predict \(+1\), predict \(-1\), or randomize. These choices can have different risks whenever \(P(f(X)=0)>0\). A tie convention that is irrelevant for a continuous score distribution need not be irrelevant for a fitted classifier that produces exact zeros.

Result: If a classifier predicts \(+1\) at ties, the contribution to its zero-one risk from the event \(T=\{f(X)=0\}\) is \(P(T,Y=-1)\). If it instead predicts \(-1\) at ties, that contribution is \(P(T,Y=+1)\).

Derivation. On \(T\), a \(+1\) prediction is wrong exactly when \(Y=-1\), so the error event restricted to \(T\) is \(T\cap\{Y=-1\}\). A \(-1\) prediction is wrong exactly when \(Y=+1\), giving \(T\cap\{Y=+1\}\). Taking probabilities yields the two contributions. If a randomized rule predicts \(+1\) with probability \(q\) at a tie, independently of the label conditional on the score, the contribution is \(qP(T,Y=-1)+(1-q)P(T,Y=+1)\). \(\square\)

Worked Example: The Tie Convention Changes the Risk

Let \(X\) be constant and let \(f(X)=0\) always. Suppose \(P(Y=+1)=0.4\) and \(P(Y=-1)=0.6\). Predicting \(+1\) at the tie gives risk \(P(Y=-1)=0.6\). Predicting \(-1\) gives risk \(P(Y=+1)=0.4\). If the rule randomizes equally between the labels, its risk is

$$ \frac12(0.6)+\frac12(0.4)=0.5. $$

All three rules use the same score. Their risks differ because converting a tied score to a label is part of the classifier definition, not an automatic consequence of the score.

When reading a margin or classification guarantee, check what classifier is covered and how ties are treated. A condition controlling the probability of scores near zero may help bound the effect of near-ties, but it does not license silently changing the prediction at an exact tie.

Error 3: Treating Separability as a Fast-Rate Assumption

Separability says that some rule can classify the relevant observations without error. It does not, on its own, control how many rules fit those observations, how complex the selected rule is, how close population points lie to a decision boundary, or how well empirical performance predicts population performance. Fast-rate conclusions use additional conditions, such as suitable noise or Bernstein conditions together with control of the estimator's complexity and approximation error. The exact hypotheses depend on the bound; separability is not a substitute for them.

Worked Example: Zero Training Error With Population Error One

Let \(X\) be uniform on \([0,1]\) and let \(Y=+1\) with probability one. The constant classifier \(g_+(x)=+1\) separates the population perfectly: its zero-one risk is zero. Consider, however, the class of all measurable classifiers. Given any finite training sample with distinct inputs \(X_1,\ldots,X_n\), define the data-dependent classifier

$$ g_D(x)= \begin{cases} +1,&x\in\{X_1,\ldots,X_n\},\\ -1,&\text{otherwise}. \end{cases} $$

It classifies every training observation correctly, so its empirical error is zero. A finite set has probability zero under the uniform distribution, however. Thus \(g_D(X)=-1\) with probability one for a fresh draw and \(R_{01}(g_D)=1\). The data are separable and an empirical zero-error rule exists, but this rule generalizes maximally poorly. The example is about an uncontrolled class: a kernel guarantee needs its own complexity or norm control, not merely a claim that the data can be separated.

This example does not show that every separable kernel problem has slow rates. It shows why separability alone cannot establish a rate. In a kernel analysis, the relevant guarantee may depend on the RKHS norm of the fitted score, the kernel's effective complexity, approximation error, a margin or noise condition, and the regularization schedule. Each assumption does a distinct job. A small empirical hinge loss, for example, is not a replacement for the population conditions in a fast-rate theorem.

Error 4: Comparing Penalties Without Comparing Objectives

Regularization parameters are not portable numbers independent of the objective's scale. A common pair of objectives is a sum of losses with a squared-norm penalty and an average loss with the same type of penalty. Since the average loss is \(1/n\) times the sum, matching the two objectives requires rescaling the penalty parameter as well.

Result: For observations with losses \(\ell_i(f)\) and penalty \(\|f\|^2\), the objectives \(J_{\mathrm{sum}}(f)=\sum_{i=1}^n\ell_i(f)+\lambda_{\mathrm{sum}}\|f\|^2\) and \(J_{\mathrm{avg}}(f)=n^{-1}\sum_{i=1}^n\ell_i(f)+\lambda_{\mathrm{avg}}\|f\|^2\) have the same minimizers if \(\lambda_{\mathrm{sum}}=n\lambda_{\mathrm{avg}}\).

Proof. Multiplying the average-loss objective by \(n>0\) leaves its minimizers unchanged. The result is

$$ nJ_{\mathrm{avg}}(f) =\sum_{i=1}^n\ell_i(f)+n\lambda_{\mathrm{avg}}\|f\|^2. $$

This equals \(J_{\mathrm{sum}}(f)\) for every \(f\) exactly when \(\lambda_{\mathrm{sum}}=n\lambda_{\mathrm{avg}}\). Since multiplication by a positive constant preserves the set of minimizers, the objectives then have the same minimizers. \(\square\)

This conversion assumes the loss and penalty are otherwise written identically. A factor such as \(1/2\) on the penalty must also be accounted for if it differs between formulations.

Worked Example: Matching a Sum Objective to an Average Objective

Take \(n=100\) observations, all with label \(+1\), and consider the constant-score model \(f(x)=t\), whose squared norm is \(t^2\). Under the sum hinge objective with \(\lambda_{\mathrm{sum}}=100\), the criterion is

$$ J_{\mathrm{sum}}(t)=100(1-t)_++100t^2. $$

For \(0\leq t\leq1\), this is \(100(1-t)+100t^2\), whose derivative is \(-100+200t\); its minimum on that interval is at \(t=1/2\). For \(t\geq1\), the criterion is \(100t^2\), minimized on that interval at \(t=1\), where its value is \(100\). At \(t=1/2\), the value is \(100(1/2)+100(1/4)=75\), so the global minimum is \(t=1/2\). For \(t<0\), the criterion is \(100(1-t)+100t^2\), which decreases as \(t\) increases toward zero and is therefore no smaller than the minimum already found.

The equivalent average objective uses \(\lambda_{\mathrm{avg}}=100/100=1\): \(J_{\mathrm{avg}}(t)=(1-t)_++t^2\). It is exactly \(J_{\mathrm{sum}}(t)/100\), so it has the same minimizer, \(t=1/2\). If one instead assigns the same numerical value \(1\) to the sum objective's penalty, its criterion is \(100(1-t)_++t^2\); on \(0\leq t\leq1\) its derivative is \(-100+2t<0\), and its minimum is at \(t=1\). The numerical penalty value alone does not identify an equivalent amount of regularization.

A Practical Audit and Common Pitfalls

Before interpreting a kernel classification guarantee, check each of the following:

  • Risk target: Is the bound for surrogate risk, zero-one risk, or an excess-risk quantity? What comparison justifies moving between them?
  • Decision rule: How is the score converted to a label at zero, and can ties occur with positive probability?
  • Rate assumptions: Does the argument use a noise or margin condition, a complexity or norm bound, and a specified approximation term? Is separability being used only as a feasibility statement?
  • Objective scale: Is the empirical loss summed or averaged? Are the penalty and any constants written with the same normalization as the theorem?

A common mistake is to read “the surrogate objective is small, the sample is separable, and the fitted score has a penalty of \(0.01\)” as enough information to infer a small classification error and a fast rate. The correction is to identify the exact population risk being bounded, fix the tie rule, verify every noise and complexity hypothesis, and translate the penalty to the theorem's objective normalization. Each step prevents a different kind of invalid comparison.

Key takeaway: A classification guarantee concerns a specified risk, decision rule, set of assumptions, and objective normalization. Changing any one of these without checking the corresponding comparison can change what the guarantee actually says.

Check Your Understanding

For each question, state the definition or calculation that supports your answer.

  1. Why does \(R_{\mathrm{log}}(f)>0\) not imply that the classifier makes an error?
  2. For \(f(X)=0\) always, how would the risk formula change if ties were predicted as \(-1\) rather than \(+1\)?
  3. What feature of the classifier class makes the zero-training-error example fail to provide a population guarantee?
  4. For \(n=50\), what average-objective penalty matches a sum-objective penalty of \(10\), with all other terms unchanged?
  5. List two kinds of assumptions, other than empirical separability, that may be needed in a fast-rate kernel classification guarantee.
Clinical Biostats