Tutorials › Statistical Learning (Graduate) › A Linear-Kernel Classification Bound Worked from First Principles

Kernel Classification Guarantees · Tutorial 786 of 989

A Linear-Kernel Classification Bound Worked from First Principles

Work from the linear norm constraint to a high-probability classification guarantee, with each estimation and calibration step made explicit.

Advanced 13 min read

What You'll Learn

  • Express a linear classifier as a norm-constrained function in the linear RKHS.
  • Derive a uniform hinge-risk deviation bound from bounded covariates.
  • Relate empirical hinge minimization to the best constrained hinge risk.
  • Verify how conditional hinge regret controls excess zero-one risk.
  • Separate estimation error from constrained-class approximation error.
  • Apply the result with explicit sample size, confidence, and norm values.

From a Linear Norm Constraint to a Risk Guarantee

A classification guarantee for a kernel method can be made concrete by considering the linear kernel first. In this setting, the reproducing-kernel Hilbert space (RKHS) consists of linear score functions, and its norm constraint directly limits how much the score can change over the covariate space. If covariates are bounded, that constraint controls the estimation error of hinge risk. Hinge calibration then translates the risk bound into a bound on classification error.

The result has two distinct sources of error. The estimation term decreases with sample size and depends on the allowed score norm and covariate bound. The approximation term records whether the norm-constrained class can achieve hinge risk close to the best possible hinge risk. Keeping these terms separate is useful: a small estimation error alone does not guarantee a good classifier if the constrained class is too restrictive.

Setup and Definitions

Let \((X_i,Y_i)_{i=1}^n\) be independent and identically distributed observations, where \(X_i\in\mathbb{R}^d\) and \(Y_i\in\{-1,+1\}\). Assume \(X\) is measurable and \(\|X\|_2\leq\kappa\) almost surely, for a finite constant \(\kappa\). For the linear kernel \(k(x,x')=x^\mathsf{T}x'\), a score function has the form \(f_w(x)=w^\mathsf{T}x\); its RKHS norm is \(\|w\|_2\). We use the norm-constrained class \(\mathcal{F}_{\Lambda}=\{f_w:\|w\|_2\leq\Lambda\}\), where \(\Lambda\geq0\). There is no separate unpenalized intercept in this definition; an intercept can be included by augmenting the covariate vector.

Definition: The hinge loss is \(\ell(y,t)=(1-yt)_+=\max\{0,1-yt\}\). For a score function \(f\), its hinge risk and empirical hinge risk are \(R_{\mathrm h}(f)=E[\ell(Y,f(X))]\) and \(\widehat R_{\mathrm h}(f)=n^{-1}\sum_{i=1}^n\ell(Y_i,f(X_i))\). The classifier associated with \(f\) predicts \(+1\) when \(f(x)\geq0\) and \(-1\) otherwise. Its zero-one risk is \(R_{01}(f)=P(Y\ne\operatorname{sign}_+(f(X)))\), where \(\operatorname{sign}_+(t)=+1\) for \(t\geq0\) and \(-1\) for \(t<0\).

Since \(|f_w(X)|\leq\|w\|_2\|X\|_2\leq\Lambda\kappa\), every loss in the class lies between zero and \(B=1+\Lambda\kappa\). This boundedness will be used for concentration; the norm constraint will control the size of the class.

Worked Example: What the Norm Constraint Controls

Suppose \(X\in\mathbb{R}^2\), \(\|X\|_2\leq1\), and \(\|w\|_2\leq2\). For any two possible covariates \(x,x'\) in this unit ball,

$$ |f_w(x)|=|w^\mathsf{T}x|\leq2,\qquad |f_w(x)-f_w(x')| =|w^\mathsf{T}(x-x')| \leq2\|x-x'\|_2. $$

Thus scores have absolute value at most 2, and their change between covariates is at most twice the Euclidean distance. The hinge loss is consequently at most \(1+2=3\). These statements hold for every allowed \(w\), not just for a fitted score. In particular, the bound concerns the entire class over which empirical risk is minimized.

A Uniform Hinge-Risk Bound

The next result gives a finite-sample deviation bound. Its probability statement requires no assumption that the data distribution has a density. In finite dimension, the parameter ball is compact and the hinge loss is continuous in \(w\); with measurable covariates, the suprema below are measurable.

Theorem: Under the setup above, for any \(0<\delta<1\), with probability at least \(1-\delta\),
$$ \sup_{f\in\mathcal{F}_{\Lambda}} |R_{\mathrm h}(f)-\widehat R_{\mathrm h}(f)| \leq \Delta_{n,\delta} := \frac{2\Lambda\kappa}{\sqrt n} + (1+\Lambda\kappa) \sqrt{\frac{\log(2/\delta)}{2n}}. $$

Proof. Subtract the constant value \(\ell(y,0)=1\) and write \(g_f(x,y)=\ell(y,f(x))-1\). This centering does not change the difference between population and empirical risks. For any fixed sample, the Rademacher average of this centered class is

$$ E_{\varepsilon}\sup_{f\in\mathcal{F}_{\Lambda}} \frac1n\sum_{i=1}^n\varepsilon_i g_f(X_i,Y_i) \leq E_{\varepsilon}\sup_{\|w\|_2\leq\Lambda} \frac1n\sum_{i=1}^n\varepsilon_i w^\mathsf{T}X_iY_i \leq \frac{\Lambda\kappa}{\sqrt n}, $$

where the \(\varepsilon_i\) are independent random signs, each equally likely to be \(+1\) or \(-1\). The first inequality is the Rademacher contraction inequality: \(t\mapsto\ell(y,t)-1\) is 1-Lipschitz and equals zero at \(t=0\). The inequality applies because multiplying the score by \(y\in\{-1,+1\}\) preserves its Lipschitz constant. For the second inequality, the supremum of the linear form over the radius-\(\Lambda\) ball is \(\Lambda\|\sum_i\varepsilon_iY_iX_i\|_2/n\). Jensen's inequality and independence of the signs give

$$ E_{\varepsilon}\left\|\sum_{i=1}^n\varepsilon_iY_iX_i\right\|_2 \leq \sqrt{E_{\varepsilon}\left\|\sum_{i=1}^n\varepsilon_iY_iX_i\right\|_2^2} = \sqrt{\sum_{i=1}^n\|X_i\|_2^2} \leq\kappa\sqrt n. $$

For either one-sided deviation, symmetrization bounds the expected supremum by twice this Rademacher average, hence by \(2\Lambda\kappa/\sqrt n\). The same bound holds for the other one-sided deviation. Changing one observation changes either supremum by at most \(B/n\), because the loss lies in \([0,B]\). McDiarmid's inequality therefore bounds the probability that either supremum exceeds its expectation by \(B\sqrt{\log(2/\delta)/(2n)}\) by at most \(\delta/2\). A union bound for the two one-sided deviations proves the stated absolute-deviation bound. \(\square\)

Worked Example: Computing the Deviation Bound

Take \(n=10{,}000\), \(\Lambda\kappa=2\), and \(\delta=0.05\). Then \(B=3\), and \(\log(2/\delta)=\log(40)\). Substitution gives

$$ \Delta_{n,\delta} = \frac{2(2)}{100} + 3\sqrt{\frac{\log(40)}{20{,}000}} = 0.04+3(0.013581\ldots) \approx0.08074. $$

Thus, with probability at least \(0.95\), every score in the class has population and empirical hinge risks differing by at most approximately \(0.08074\). The conclusion is uniform: it remains valid for a score chosen by minimizing empirical risk on these same observations.

Empirical Minimization and the Constrained Oracle

Let \(\widehat f\in\mathcal{F}_{\Lambda}\) be an empirical hinge-risk minimizer. More generally, suppose it is an approximate minimizer satisfying \(\widehat R_{\mathrm h}(\widehat f)\leq\inf_{f\in\mathcal{F}_{\Lambda}}\widehat R_{\mathrm h}(f)+\varepsilon\), where \(\varepsilon\geq0\) is the optimization tolerance. Define the best constrained risk gap by \(A_{\Lambda}=\inf_{f\in\mathcal{F}_{\Lambda}}R_{\mathrm h}(f)-R_{\mathrm h}^*\), where \(R_{\mathrm h}^*=\inf_f R_{\mathrm h}(f)\) is the smallest hinge risk over measurable real-valued score functions.

Result: On the event in the uniform deviation theorem,
$$ R_{\mathrm h}(\widehat f)-R_{\mathrm h}^* \leq A_{\Lambda}+2\Delta_{n,\delta}+\varepsilon. $$

Derivation. For any \(f\in\mathcal{F}_{\Lambda}\), the uniform deviation event and the approximate-minimization property imply

$$ \begin{aligned} R_{\mathrm h}(\widehat f) &\leq \widehat R_{\mathrm h}(\widehat f)+\Delta_{n,\delta}\\ &\leq \widehat R_{\mathrm h}(f)+\varepsilon+\Delta_{n,\delta}\\ &\leq R_{\mathrm h}(f)+\varepsilon+2\Delta_{n,\delta}. \end{aligned} $$

Taking the infimum over \(f\in\mathcal{F}_{\Lambda}\) and subtracting \(R_{\mathrm h}^*\) gives the result. This argument does not require an optimizer of the population risk to exist. \(\square\)

Worked Example: Checking the Two Deviation Terms

In the preceding numerical setup, suppose \(A_{\Lambda}\leq0.03\), and suppose empirical minimization is exact, so \(\varepsilon=0\). The excess hinge-risk bound is

$$ A_{\Lambda}+2\Delta_{n,\delta} \leq 0.03+2\left\{0.04+3\sqrt{\frac{\log(40)}{20{,}000}}\right\} \approx0.191486. $$

Rounded to four decimal places, this is approximately \(0.1915\). It is an upper bound with probability at least \(0.95\). Rounding it down to \(0.1914\) would not be a valid rounded upper bound. If the optimization tolerance were instead \(\varepsilon=0.005\), the bound would increase by exactly \(0.005\), to approximately \(0.1965\).

Why Hinge Regret Controls Classification Risk

A hinge-risk bound is useful for classification because hinge loss is calibrated to zero-one loss. The key point is a pointwise statement about the conditional risks; it does not require a margin or low-noise assumption.

Result: For any measurable score function \(f\), with the threshold convention \(\operatorname{sign}_+(0)=+1\),
$$ R_{01}(f)-R_{01}^* \leq R_{\mathrm h}(f)-R_{\mathrm h}^*, $$

where \(R_{01}^*=\inf_g R_{01}(g)\) is the Bayes classification risk.

Proof. Let \(\eta(x)=P(Y=+1\mid X=x)\). At a fixed \(x\), the conditional hinge risk of score \(t\) is \(C_{\eta}(t)=\eta(1-t)_+ +(1-\eta)(1+t)_+\). For \(-1\leq t\leq1\), this equals \(1+(1-2\eta)t\). For \(t\geq1\), it equals \((1-\eta)(1+t)\); for \(t\leq-1\), it equals \(\eta(1-t)\). Consequently,

$$ \inf_{t\in\mathbb{R}}C_{\eta}(t)=2\min(\eta,1-\eta). $$

For \(1/2\leq\eta<1\), the minimum is attained at \(t=1\); when \(\eta=1\), it is attained at every \(t\geq1\). For \(0<\eta<1/2\), the minimum is attained at \(t=-1\); when \(\eta=0\), it is attained at every \(t\leq-1\). At \(\eta=1/2\), every \(t\in[-1,1]\) minimizes the conditional risk.

If \(\eta>1/2\), the Bayes decision is \(+1\), and a wrong decision under our threshold convention requires \(t<0\). On \([-1,0]\), \(C_{\eta}(t)\geq C_{\eta}(0)=1\), while for \(t\leq-1\), \(C_{\eta}(t)=\eta(1-t)\geq2\eta\). In either region, the hinge-risk excess is at least \(2\eta-1\), the conditional zero-one excess. If \(\eta<1/2\), the Bayes decision is \(-1\), and a wrong decision requires \(t\geq0\). For \(0\leq t\leq1\), \(C_{\eta}(t)\geq1\); for \(t\geq1\), \(C_{\eta}(t)\geq2(1-\eta)\). The hinge-risk excess is therefore at least \(1-2\eta\), again the conditional zero-one excess. When \(\eta=1/2\), the conditional zero-one excess is zero. Integrating these inequalities over \(X\) proves the result. \(\square\)

Worked Example: From Hinge Risk to Classification Risk

Suppose at a covariate value \(x\), \(\eta(x)=0.75\). The Bayes decision is \(+1\), and the minimum conditional hinge risk is \(2(1-0.75)=0.5\), attained at \(t=1\). A score \(t=0\) is classified as \(+1\), so its conditional classification excess is zero. Its hinge risk is \(C_{0.75}(0)=1\), giving hinge excess \(1-0.5=0.5\), which is at least the classification excess.

By contrast, score \(t=-1\) gives the wrong decision. Its conditional classification excess is \(2(0.75)-1=0.5\). Its hinge risk is \(0.75(1-(-1))=1.5\), so its hinge excess is \(1.5-0.5=1\), again larger than the classification excess. The calculation illustrates why the guarantee is an inequality, not generally an equality.

The Classification Guarantee and a Common Pitfall

Combining the empirical-minimization result with hinge calibration gives the promised classification guarantee. With probability at least \(1-\delta\),

$$ R_{01}(\widehat f)-R_{01}^* \leq A_{\Lambda} + \frac{4\Lambda\kappa}{\sqrt n} + 2(1+\Lambda\kappa)\sqrt{\frac{\log(2/\delta)}{2n}} +\varepsilon. $$

The norm and covariate bound enter through the estimation terms, while \(A_{\Lambda}\) captures the limitations of the constrained linear class. Increasing \(\Lambda\) can reduce approximation error, but it also increases the estimation bound. Choosing the norm constraint is therefore a balance, not a reason to make the allowed norm as large as possible.

Common pitfall: confusing the minimum value with all its minimizers. For example, when \(\eta=0.75\), the conditional minimum is \(0.5\), but the score \(t=2\) has risk \(0.25(1+2)=0.75\), not \(0.5\). The minimum is attained at \(t=1\) for \(1/2\leq\eta<1\); only when \(\eta=1\) are all \(t\geq1\) minimizers. Similarly, for \(0<\eta<1/2\), the minimum is attained at \(t=-1\), not at every \(t\leq-1\). The endpoint families of minimizers occur only at \(\eta=0\) and \(\eta=1\). This distinction matters when proving calibration pointwise.

Key takeaway: Bounded covariates and a linear RKHS norm constraint yield a uniform hinge-risk estimation bound. Empirical optimization adds at most twice that deviation, and hinge calibration transfers the resulting excess hinge risk to excess classification risk.

Check Your Understanding

Use the definitions and bounds above to check each step of the argument.

  1. Why is the hinge loss bounded by \(1+\Lambda\kappa\) throughout the norm-constrained class?
  2. Which terms in the classification guarantee decrease as \(n\) increases, and which term represents constrained-class approximation?
  3. For \(\eta=0.8\), what score attains the conditional hinge-risk minimum, and what is the minimum value?
  4. How does an optimization tolerance \(\varepsilon\) change the excess hinge-risk and classification-risk guarantees?
  5. In the numerical example, why is \(0.1915\), rather than \(0.1914\), the valid four-decimal upper-bound rounding?
Clinical Biostats