Why Probability Errors Matter for Decisions
A multiclass probability estimate is useful because it can be converted into a decision: predict a class, select a treatment, or choose another action. The best decision depends not only on which class is most probable, but also on the task loss attached to each possible action and outcome. A small error in estimated probabilities therefore has no single fixed effect on decision quality: its effect is controlled by the range of the loss.
This tutorial gives a direct guarantee for a plug-in rule: compute conditional risks using estimated class probabilities, then choose an action with the smallest estimated risk. The bound applies to general finite multiclass loss matrices. It does not require a particular probability-estimation method or a margin condition.
Setup and Definition
Let \(Y\) take values in the finite class set \(\{1,\ldots,K\}\), and let \(\mathcal A\) be a finite set of available actions. The action set need not be identical to the class set. A loss matrix \(L\) assigns a finite loss \(L(a,y)\) to each action \(a\in\mathcal A\) when the true class is \(y\). Smaller loss is preferred.
At a fixed covariate value \(x\), write \(\eta_y(x)=P(Y=y\mid X=x)\) for the true class probabilities. They form a probability vector \(\eta(x)\). Suppose an estimate \(\hat\eta(x)\) is also a probability vector: each entry is nonnegative and its entries sum to one. For any probability vector \(p\), the conditional risk of action \(a\) is the expected loss when the class probabilities are \(p\).
Define the global loss range by
A common additive constant in all entries of the loss matrix does not affect decisions or excess risk; the range \(\Delta\) captures the relevant scale. If \(\Delta=0\), all actions have the same loss for every class, so every decision has zero excess risk.
Worked Example: Zero-One Loss With Three Classes
Under zero-one loss, an incorrect prediction costs 1 and a correct prediction costs 0. Suppose the true probabilities are \(p=(0.52,0.30,0.18)\), while the estimated probabilities are \(q=(0.40,0.42,0.18)\). The plug-in rule predicts class 2, since \(0.42\) is the largest estimated probability. The Bayes rule predicts class 1, since \(0.52\) is the largest true probability.
Under zero-one loss, the conditional risk of predicting class \(j\) is \(1-p_j\). Thus the plug-in action has true risk \(1-0.30=0.70\), and the Bayes action has risk \(1-0.52=0.48\). The excess risk is \(0.70-0.48=0.22\).
The probability-estimation error in the sum of absolute coordinate errors is \(\lVert p-q\rVert_1=|0.52-0.40|+|0.30-0.42|+|0.18-0.18|=0.12+0.12+0=0.24\). Here \(\Delta=1\), so the range bound below gives excess risk at most \(1(0.24)=0.24\), which is indeed greater than \(0.22\).
A Risk Perturbation Bound
The first step is to control how much the risk of a fixed action changes when its probability vector changes. For two probability vectors \(p\) and \(q\), their total variation distance is \(\operatorname{TV}(p,q)=\frac12\sum_y|p_y-q_y|\). For a fixed action, the losses across classes lie within an interval no wider than \(\Delta\).
Proof. Put \(d_y=p_y-q_y\). Since \(p\) and \(q\) both sum to one, \(\sum_y d_y=0\). The total positive mass in \(d\) equals the absolute total negative mass; denote each by \(t\). Then \(t=\frac12\sum_y|d_y|=\operatorname{TV}(p,q)\). Let \(m=\min_y L(a,y)\) and set \(c_y=L(a,y)-m\). We have \(0\leq c_y\leq\Delta\). Subtracting \(m\) does not change the risk difference, because \(\sum_y d_y=0\). The positive and negative parts of \(\sum_y c_y d_y\) each have magnitude between 0 and \(\Delta t\), so their difference has absolute value at most \(\Delta t\). This proves the inequality. \(\square\)
Worked Example: Cost-Sensitive Decisions
Consider three actions and three classes, with rows of the loss matrix corresponding to actions:
Let the true probabilities be \(p=(0.60,0.30,0.10)\), and the estimates be \(q=(0.30,0.60,0.10)\). Under \(p\), the three risks are \(R_p(a_1)=0(0.60)+4(0.30)+4(0.10)=1.6\), \(R_p(a_2)=3(0.60)+0(0.30)+3(0.10)=2.1\), and \(R_p(a_3)=2(0.60)+2(0.30)+0(0.10)=1.8\). Thus \(a_1\) is Bayes-optimal.
Under \(q\), the risks are \(R_q(a_1)=0(0.30)+4(0.60)+4(0.10)=2.8\), \(R_q(a_2)=3(0.30)+0(0.60)+3(0.10)=1.2\), and \(R_q(a_3)=2(0.30)+2(0.60)+0(0.10)=1.8\). The plug-in action is \(a_2\). Its true excess risk is \(2.1-1.6=0.5\).
The loss range is \(\Delta=4-0=4\), and \(\lVert p-q\rVert_1=0.30+0.30+0=0.60\). The excess-risk bound is \(4(0.60)=2.4\). It is valid but conservative; the actual excess risk is \(0.5\). Cost-sensitive decision changes can thus be bounded even when the plug-in rule is not simply the most-probable-class rule.
Excess Risk of the Plug-In Rule
Proof. Add and subtract the two risks computed under \(q\):
The middle bracket is nonpositive because \(a_q\) minimizes risk under \(q\). Each of the other brackets is at most its absolute value, which is at most \(\frac{\Delta}{2}\lVert p-q\rVert_1\) by the lemma. Adding these two bounds gives the stated inequality. \(\square\)
The factor of two relative to the one-action perturbation bound is important: the estimated action is chosen by comparing two actions, and the probability error can affect both of their risks. The result requires no unique minimizer; any minimizers selected under the stated tie rule satisfy it.
Worked Example: Aggregating Risk Across Covariate Groups
Suppose \(X\) has two possible values, \(x_1\) and \(x_2\), each with probability \(1/2\), and use three-class zero-one loss. At \(x_1\), let \(\eta(x_1)=(0.70,0.20,0.10)\) and \(\hat\eta(x_1)=(0.45,0.45,0.10)\). Fix a tie rule that chooses class 2 in this tie. The plug-in prediction is class 2, while the Bayes prediction is class 1. The conditional excess risk is \(0.70-0.20=0.50\), and the probability error is \(0.25+0.25+0=0.50\).
At \(x_2\), let \(\eta(x_2)=(0.20,0.50,0.30)\) and \(\hat\eta(x_2)=(0.25,0.45,0.30)\). Both rules predict class 2, so the conditional excess risk is 0. The probability error is \(0.05+0.05+0=0.10\).
Averaging over the two equally likely covariate values gives population excess risk \(\frac12(0.50)+\frac12(0)=0.25\). The expected probability-error bound is \(\Delta E[\lVert\eta(X)-\hat\eta(X)\rVert_1]=1\{\frac12(0.50)+\frac12(0.10)\}=0.30\). The aggregate bound holds, and it remains valid even though the estimate at \(x_1\) creates a tie.
From Conditional Risk to Population Risk
Let \(g_{\hat\eta}(x)\) be the plug-in action at covariate value \(x\), and let \(g^*(x)\) be a Bayes action. The population risk of a rule \(g\) is \(R(g)=E[L(g(X),Y)]\). Assume the conditional probabilities and estimated probabilities are measurable functions of \(x\), the action set is finite, and the loss values are finite. A fixed tie-breaking rule then makes the decisions measurable. Applying the theorem separately at each \(x\) and taking expectations gives
If \(\hat\eta\) is estimated from a training sample, this statement holds conditional on that sample: treat the fitted probabilities as fixed, apply the pointwise result, and average over a new covariate and outcome. Taking expectation over the training sample then gives the corresponding unconditional bound, provided the expectations exist. In particular, if every coordinate error is at most \(\epsilon(x)\), then \(\lVert\eta(x)-\hat\eta(x)\rVert_1\leq K\epsilon(x)\), yielding the looser bound \(\Delta K E[\epsilon(X)]\).
Interpretation and Common Pitfalls
The result separates two ingredients. The probability estimator determines the size of the error in the class-probability vector, measured here by the sum of absolute coordinate errors. The task determines how costly a given probability error can be through \(\Delta\). A large loss range permits a larger excess-risk bound for the same probability accuracy. Conversely, the bound can be conservative when only a few actions are competitive or when their losses vary little across the classes receiving probability error.
- Using only one risk comparison. The lemma bounds the change in risk for one fixed action by \(\frac{\Delta}{2}\lVert p-q\rVert_1\). Applying that bound once does not bound the regret of a decision selected under \(q\): both the selected action and the true optimal action enter the comparison. The decomposition above uses two perturbation terms, giving \(\Delta\lVert p-q\rVert_1\).
- Assuming the most probable class is always optimal. That is true for zero-one loss, but not for a general loss matrix. The plug-in rule must minimize the estimated conditional task risk.
- Ignoring the scale of the loss. A probability-error bound alone is not a task-risk bound. Multiplying by the loss range converts the probability discrepancy into the correct loss scale.
Check Your Understanding
Use the definitions and bounds above to answer the following.
- Why is the conditional risk of an action a linear function of the class-probability vector?
- For two probability vectors, why does the positive mass of their coordinatewise difference equal half its sum of absolute values?
- In the plug-in regret proof, which term is nonpositive, and why?
- If the loss matrix is shifted by adding the same constant to every entry, what happens to decisions, excess risk, and the loss range?
- Suppose \(K=5\), \(\Delta=3\), and every probability-coordinate error is at most \(0.02\). What bound follows from the coordinatewise-error version?