Tutorials › Statistical Learning (Graduate) › Inverting Calibration Bounds for Classification Rates

Surrogate Losses and Calibration · Tutorial 527 of 989

Inverting Calibration Bounds for Classification Rates

Convert a bound on surrogate excess risk into a classification-regret bound, and see how the calibration function determines the rate.

Advanced 10 min read

What You'll Learn

  • State the calibration inequality needed to transfer surrogate excess risk to classification regret.
  • Invert a nondecreasing calibration function, including cases where an ordinary inverse is unavailable.
  • Derive the clipped inverse for power-law calibration functions.
  • Convert local power-law lower bounds into classification-regret rates.
  • Interpret high-probability surrogate bounds as classification guarantees.
  • Identify common errors when applying calibration bounds.

From Surrogate Error to Classification Regret

A surrogate loss is useful for classification only if its excess risk controls the excess zero-one risk of the classifier it produces. The calibration function gives this control on the surrogate-risk scale: it tells us how much surrogate excess risk must accompany a specified amount of classification regret. To turn a surrogate guarantee into a classification guarantee, we reverse that relationship.

Write \(R(h)\) for the zero-one risk of a classifier \(h\), and \(R^*=\inf_h R(h)\) for the optimal zero-one risk. For a score function \(s\), let \(h_s\) be its associated classifier, and write \(R_\phi(s)\) for its risk under a surrogate loss \(\phi\). Let \(R_\phi^*=\inf_s R_\phi(s)\), where the infimum is over the score functions under consideration. Their excess risks are

$$ \Delta(h_s)=R(h_s)-R^*, \qquad \Delta_\phi(s)=R_\phi(s)-R_\phi^*. $$

The calibration inequality is the starting point. In what follows, assume it holds for every score function under consideration. The bound we derive is deterministic; if a surrogate-risk bound holds only on an event, the classification bound holds on that same event.

Definition: A calibration function for the scores and classifiers under consideration is a nondecreasing function \(\psi:[0,1]\to[0,\infty)\) with \(\psi(0)=0\) such that \(\psi(\Delta(h_s))\leq\Delta_\phi(s)\) for every score function \(s\). Here \(\Delta(h_s)\) is between 0 and 1 because it is an excess zero-one risk.

The inequality says that classification regret is first passed through \(\psi\), and the result is no larger than surrogate excess risk. If \(\psi\) is strictly increasing, this suggests applying its inverse. A generalized inverse makes the same operation precise even if \(\psi\) has flat portions.

The Inverse Calibration Bound

For \(\delta\geq 0\), define the generalized inverse

$$ \psi^{\leftarrow}(\delta) = \sup\{u\in[0,1]:\psi(u)\leq\delta\}. $$

The set in this definition is nonempty because \(\psi(0)=0\). Its supremum lies in \([0,1]\), so the definition automatically respects the largest possible classification regret. If \(\psi\) is continuous and strictly increasing, this is its ordinary inverse for \(\delta<\psi(1)\), and it equals 1 for \(\delta\geq\psi(1)\).

Theorem: Suppose \(\psi\) is a calibration function and \(\Delta_\phi(s)\leq\delta\). Then \(\Delta(h_s)\leq\psi^{\leftarrow}(\delta)\).

Proof. The calibration inequality and the assumed surrogate bound give \(\psi(\Delta(h_s))\leq\Delta_\phi(s)\leq\delta\). Thus \(\Delta(h_s)\) belongs to the set whose supremum defines \(\psi^{\leftarrow}(\delta)\). Every element of that set is at most its supremum. Therefore \(\Delta(h_s)\leq\psi^{\leftarrow}(\delta)\). \(\square\)

For a strictly increasing calibration function, the theorem is ordinary inversion: apply \(\psi^{-1}\) to both sides of \(\psi(\Delta(h_s))\leq\delta\). The generalized-inverse proof does not require strict increase or continuity. It also shows why the bound is clipped at 1: no classifier can have excess zero-one risk greater than 1.

Power-Law Calibration

A common form, especially near zero, is a power law. For an exact power-law calibration function \(\psi(u)=c u^q\) on \([0,1]\), where \(c>0\) and \(q>0\), inversion gives a simple expression.

Result: If \(\psi(u)=c u^q\) on \([0,1]\), then for every \(\delta\geq0\), \[ \psi^{\leftarrow}(\delta) = \min\left\{1,\left(\frac{\delta}{c}\right)^{1/q}\right\}. \]

Derivation. The condition \(\psi(u)\leq\delta\) is \(c u^q\leq\delta\). Since \(c>0\) and \(q>0\), this is equivalent to \(u\leq(\delta/c)^{1/q}\). Restricting \(u\) to \([0,1]\), the largest admissible value is \((\delta/c)^{1/q}\) if that value is less than 1, and 1 otherwise. This gives the stated formula.

For small \(\delta\), the inverse is proportional to \(\delta^{1/q}\). Thus an excess surrogate risk of order \(n^{-\beta}\) yields a classification-regret bound of order \(n^{-\beta/q}\), when the same power law applies in the relevant range. Larger \(q\) means a flatter calibration function near zero and, consequently, a weaker rate after inversion.

Worked Example: Inverting a Quadratic Calibration Function

Suppose \(\psi(u)=u^2/2\) on \([0,1]\), and a score has surrogate excess risk at most \(0.02\). Find the resulting classification-regret bound.

Here \(c=1/2\), \(q=2\), and \(\delta=0.02\). The inverse formula gives

$$ \Delta(h_s) \leq \min\left\{1,\left(\frac{0.02}{1/2}\right)^{1/2}\right\} = \sqrt{0.04} = 0.2. $$

The bound checks directly: \(\psi(0.2)=(0.2)^2/2=0.02\). Because \(\psi\) is increasing, any regret larger than \(0.2\) would have calibration value larger than \(0.02\), contradicting the assumed surrogate bound.

Worked Example: A Linear Power Law

Let \(\psi(u)=u/2\), and suppose \(\Delta_\phi(s)\leq0.15\). Since \(c=1/2\) and \(q=1\), inversion gives

$$ \Delta(h_s) \leq \min\left\{1,\frac{0.15}{1/2}\right\} = 0.30. $$

Indeed, \(\psi(0.30)=0.15\). The linear calibration function makes the classification-regret bound linear in the surrogate excess-risk bound, unlike the square-root bound in the previous example.

Worked Example: A Fourth-Power Calibration Function

Suppose \(\psi(u)=u^4/2\) and \(\Delta_\phi(s)\leq1/32\). Then \(c=1/2\), \(q=4\), and

$$ \Delta(h_s) \leq \min\left\{1,\left(\frac{1/32}{1/2}\right)^{1/4}\right\} = \left(\frac{1}{16}\right)^{1/4} = \frac{1}{2}. $$

Checking the endpoint, \(\psi(1/2)=(1/2)^4/2=1/32\). Compared with a quadratic calibration function, this fourth-power function gives a larger regret bound at small surrogate excess risk: taking a fourth root shrinks small numbers less than taking a square root.

Local Power Laws and Rates

Some calibration functions are not exact power laws on the entire interval \([0,1]\). A local lower bound is often enough. If \(\psi(u)\geq c u^q\) for \(0\leq u\leq u_0\), and a surrogate excess-risk bound \(\delta\) is smaller than \(\psi(u_0)\), then any regret \(r\) satisfying \(\psi(r)\leq\delta\) must be below \(u_0\). The power-law lower bound can then be inverted within its valid range.

Result: Suppose \(\psi\) is nondecreasing, \(\psi(u)\geq c u^q\) for \(0\leq u\leq u_0\), with \(c>0\), \(q>0\), and \(u_0\leq1\). If \(\Delta_\phi(s)\leq\delta<\psi(u_0)\), then \[ \Delta(h_s)\leq\left(\frac{\delta}{c}\right)^{1/q}. \]

Proof. Set \(r=\Delta(h_s)\). Calibration gives \(\psi(r)\leq\delta\). If \(r\geq u_0\), monotonicity would imply \(\psi(r)\geq\psi(u_0)>\delta\), a contradiction. Hence \(r<u_0\), where the local lower bound applies. Therefore \(c r^q\leq\psi(r)\leq\delta\), and taking the positive \(q\)th root yields \(r\leq(\delta/c)^{1/q}\). \(\square\)

Worked Example: Converting a High-Probability Rate

Suppose \(\psi(u)=u^2/2\) and an estimator \(s_n\) satisfies \(P\{\Delta_\phi(s_n)\leq0.08/n\}\geq0.95\). Convert this surrogate-risk statement to a classification-regret statement.

On the event \(\Delta_\phi(s_n)\leq0.08/n\), the quadratic inverse bound gives

$$ \Delta(h_{s_n}) \leq \min\left\{1,\sqrt{\frac{0.08/n}{1/2}}\right\} = \min\left\{1,\sqrt{\frac{0.16}{n}}\right\}. $$

For every integer \(n\geq1\), \(\sqrt{0.16/n}=0.4/\sqrt{n}\leq0.4<1\), so the minimum is \(0.4/\sqrt n\). The event on which this conclusion holds has probability at least \(0.95\); consequently, \(P\{\Delta(h_{s_n})\leq0.4/\sqrt n\}\geq0.95\). The exponent has changed from \(n^{-1}\) for surrogate excess risk to \(n^{-1/2}\) for classification regret because the inverse calibration function takes a square root.

Using the Bound Correctly

The inverse calculation is short, but it is easy to reverse the relationship or use a calibration function outside the range where it is valid. Keep the direction of the calibration inequality explicit: \(\psi(\text{classification regret})\leq\text{surrogate excess risk}\). The task is to bound the regret by applying an inverse, not to apply \(\psi\) to the surrogate bound.

  • Wrong: If \(\psi(u)=u^2/2\) and surrogate excess risk is at most \(\delta\), conclude regret is at most \(\psi(\delta)=\delta^2/2\). Correction: Invert the inequality to obtain the bound \(\sqrt{2\delta}\), clipped at 1.
  • Wrong: Treat a local approximation near zero as an exact formula for every regret value. Correction: Check that the resulting bound lies in the range where the power-law lower bound holds; the local result above states a sufficient condition.
  • Wrong: Apply a high-probability surrogate bound and report the classification conclusion as certain. Correction: The inverse argument preserves the event and its probability; it does not remove the uncertainty in the original bound.
  • Wrong: Ignore the range of possible classification regret when the inverse expression exceeds 1. Correction: Use the clipped bound, since excess zero-one risk cannot exceed 1.

The shape of \(\psi\) is therefore more than a technical detail. It determines how efficiently a surrogate-risk guarantee transfers to classification. When \(\psi(u)\) behaves like \(c u^q\) near zero, the exponent \(1/q\) controls the conversion of small surrogate errors into small classification regret.

Check Your Understanding

Use the direction of the calibration inequality and the range of the inverse carefully.

  1. If \(\psi(u)=u^2/4\) and surrogate excess risk is at most \(0.01\), what classification-regret bound follows?
  2. Why does the generalized-inverse definition still give a valid bound when \(\psi\) has a flat interval?
  3. If a local lower bound \(\psi(u)\geq c u^q\) holds only for \(u\leq u_0\), what condition on the surrogate excess-risk bound allows that local inequality to be used?
  4. A surrogate excess-risk bound is \(O(n^{-2})\), and the calibration function behaves like \(c u^4\) near zero. What classification-regret rate does inversion suggest?
  5. Suppose a surrogate bound holds with probability at least \(1-\alpha\). What probability can be guaranteed for the classification bound obtained by inversion?
Clinical Biostats