Why the Range of a Loss Matters
A loss assigns a numerical penalty to a prediction and the outcome it is meant to predict. Its scale affects how large a reported risk looks: a risk of 8 may be small when losses range from 0 to 100, but large when they range from 0 to 10. A bound on the loss also immediately bounds its expected value, so it provides a simple check on risk calculations.
There is no single convention for reporting loss ranges. Some losses take values in \([0,1]\); others lie in \([0,B]\), or in a general interval \([a,b]\). The endpoints and the width of the interval carry different information. In particular, a maximum value is not the same as the width of the range when the loss has a positive lower bound.
Definition and Range Conventions
Let \(Z=(X,Y)\) denote an observation with distribution \(P\), let \(h\) be a prediction rule, and let \(\mathcal{L}(h,Z)\) be its loss. Assume that, for each predictor under discussion, \(z\mapsto\mathcal{L}(h,z)\) is measurable. Its population risk is \(R_P(h)=E_P[\mathcal{L}(h,Z)]\), when this expectation exists.
A declared bounding interval need not be the smallest possible one. For example, a loss that only takes the values 0 and 1 is bounded in \([0,2]\), but \([0,2]\) is not its tightest interval. When referring to the loss's actual range, we mean the set of values it can take; when referring to a bound, we mean an interval known to contain those values. In common statistical usage, “range” may also mean interval width. To avoid ambiguity, this tutorial uses interval width for \(b-a\).
Sometimes a bound holds only almost surely under \(P\): for a fixed predictor \(h\), \(a\leq\mathcal{L}(h,Z)\leq b\) with probability one. That is enough to bound \(R_P(h)\), because changes on a probability-zero event do not change an expectation. It is weaker than a pointwise bound over the whole observation space. It may also depend on \(P\) or on \(h\); a shared bound over all predictors is a stronger and often more useful statement.
Worked Example: Zero-One Loss on a Finite Distribution
Let \(Y\in\{0,1\}\), and let a classifier \(h\) predict either 0 or 1. The zero-one loss is \(\mathcal{L}(h,(x,y))=\mathbf{1}\{h(x)\ne y\}\), which equals 1 for an incorrect prediction and 0 for a correct one. Suppose the classifier is correct with probability \(0.82\) and incorrect with probability \(0.18\).
The loss takes values in \(\{0,1\}\), so it is bounded in \([0,1]\) and its interval width is 1. Its risk is the expected loss: \(R_P(h)=0(0.82)+1(0.18)=0.18\).
If the same loss is reported in percentage units, define \(\mathcal{L}_{\%}=100\mathcal{L}\). It then takes values in \(\{0,100\}\), and its risk is \(E_P[\mathcal{L}_{\%}]=0(0.82)+100(0.18)=18\). The numerical risk changed from \(0.18\) to \(18\), while both numbers describe the same error frequency on different scales.
Bounds on Population Risk
The basic consequence of boundedness is that expectation stays within the same interval. This conclusion does not require a finite observation space. It only requires a measurable loss and an almost-sure bound under the distribution being used.
Proof. The random variable \(\mathcal{L}(h,Z)\) is measurable and bounded almost surely, so it is integrable. The random variables \(\mathcal{L}(h,Z)-a\) and \(b-\mathcal{L}(h,Z)\) are nonnegative almost surely. Their expectations are therefore nonnegative. By linearity of expectation, \(E_P[\mathcal{L}(h,Z)]-a\geq 0\) and \(b-E_P[\mathcal{L}(h,Z)]\geq 0\). Rearranging gives \(a\leq R_P(h)\leq b\). \(\square\)
The bound applies separately to each predictor satisfying the hypothesis. If the same \([a,b]\) bound holds for every predictor in a class, then every risk in that class lies in \([a,b]\). In particular, a loss in \([0,B]\) gives \(0\leq R_P(h)\leq B\); its risk cannot exceed its maximum possible loss.
Worked Example: Squared Error on Bounded Values
Suppose the response \(Y\) and a prediction \(h(X)\) both lie in \([0,1]\). Use squared-error loss, \(\mathcal{L}(h,(X,Y))=(h(X)-Y)^2\). Since the difference between two numbers in \([0,1]\) lies in \([-1,1]\), its square lies in \([0,1]\). Thus this loss is bounded in \([0,1]\), and the risk is between 0 and 1.
For a concrete distribution, let \(Y=0\) with probability \(0.25\) and \(Y=1\) with probability \(0.75\), and consider the constant prediction \(h(X)=0.4\). When \(Y=0\), the loss is \((0.4-0)^2=0.16\). When \(Y=1\), it is \((0.4-1)^2=(-0.6)^2=0.36\). Therefore \(R_P(h)=0.25(0.16)+0.75(0.36)=0.04+0.27=0.31\), which satisfies the bound \(0\leq0.31\leq1\).
The restriction that predictions and responses lie in \([0,1]\) matters: it is what gives the unit bound here. Without restrictions on their possible values, squared error need not have any finite upper bound.
Changing the Scale and Comparing Predictors
A common convention is to transform a loss bounded in \([a,b]\), with \(a<b\), into a unit-bounded loss by subtracting its lower bound and dividing by its interval width: \(\widetilde{\mathcal{L}}(h,z)=(\mathcal{L}(h,z)-a)/(b-a)\). This maps the bounding interval \([a,b]\) to \([0,1]\). The transformed risk can be calculated directly from the original one.
Proof. By definition, \(\widetilde{R}_P(h)=E_P[c\mathcal{L}(h,Z)+d]\). Linearity of expectation gives \(\widetilde{R}_P(h)=cE_P[\mathcal{L}(h,Z)]+d=cR_P(h)+d\). For any pair \(h_1,h_2\), subtracting the transformed risks gives \(\widetilde{R}_P(h_1)-\widetilde{R}_P(h_2)=c(R_P(h_1)-R_P(h_2))\). Since \(c>0\), this difference has the same sign as the original risk difference. Thus the ordering, including ties, is unchanged. \(\square\)
For unit-interval normalization, \(c=1/(b-a)>0\) and \(d=-a/(b-a)\). Consequently, \(\widetilde{R}_P(h)=(R_P(h)-a)/(b-a)\). The transformed risk is not generally just the original risk divided by the width: the subtraction of \(a\) is also needed if the loss has a positive lower bound. If \(a=0\), the subtraction has no effect.
Worked Example: Normalizing a Loss Bounded Away From Zero
Suppose a cost loss takes values in \([2,10]\), and two predictors have risks \(R_P(h_A)=4\) and \(R_P(h_B)=7\). The interval width is \(10-2=8\), not 10. Normalize by defining \(\widetilde{\mathcal{L}}=(\mathcal{L}-2)/8\). The transformed loss ranges from \((2-2)/8=0\) to \((10-2)/8=1\).
The transformed risks are \(\widetilde{R}_P(h_A)=(4-2)/8=2/8=0.25\) and \(\widetilde{R}_P(h_B)=(7-2)/8=5/8=0.625\). The original ordering \(4<7\) is preserved as \(0.25<0.625\). By contrast, dividing the risks by 8 without subtracting 2 would give \(0.5\) and \(0.875\), which does not correspond to the stated unit-interval loss transformation.
The same affine calculation applies to empirical averages whenever they are defined: applying the same positive scale and common offset to each observed loss transforms every predictor's empirical average in the same way. This does not mean every change in a loss convention preserves rankings. The scale and offset must be shared across the predictors being compared.
A Common Mistake and a Practical Check
A frequent mistake is to say that any rescaling leaves the preferred predictor unchanged. That claim is too broad. For instance, multiplying every loss by the same positive constant preserves rankings, but multiplying each predictor's loss by a different constant need not. Suppose \(h_A\) has risk 2 and \(h_B\) has risk 3. The first is preferred under the original loss. If, instead, the reported losses for \(h_A\) are multiplied by 2 while those for \(h_B\) are multiplied by 0.5, the reported risks become 4 and 1.5, reversing the ranking. This is not a common rescaling of one loss; it changes the comparison between predictors.
A related error is to confuse a maximum with a width. For a loss in \([2,10]\), the maximum is 10, the minimum is 2, and the width is 8. Stating which quantity is being used prevents incorrect normalizations. Before interpreting or comparing risks, check the loss interval, whether its bounds hold for all relevant observations and predictors, and whether any transformation is shared across the comparison.
Check Your Understanding
Use the definitions and results above to answer the following questions.
- A loss is bounded in \([3,9]\). What are its upper bound, lower bound, and interval width? What interval does its risk lie in?
- A loss takes values in \([0,5]\). Give the formula for its unit-interval normalization and for the corresponding transformed risk.
- Two predictors have risks 1.2 and 1.8. What happens to their ordering if the common loss is multiplied by 10 and then increased by 4?
- Why does a bound that holds almost surely for a fixed predictor suffice to bound that predictor's risk?
- Explain why normalizing a loss separately for each predictor may change the ranking, even if every normalized loss lies in \([0,1]\).