Tutorials › Exam PA - Predictive Analytics › Threshold Choice Under Unequal Error Costs

Exam PA · Case Reporting and Common Traps · Tutorial 950 of 966

Threshold Choice Under Unequal Error Costs

Use the relative costs of false positives and false negatives to justify a classification threshold and explain its effect on decisions and expected errors.

Advanced 11 min read

What You'll Learn

  • Define false-positive and false-negative costs for a binary classification decision
  • Derive the cost-minimizing threshold from calibrated probabilities
  • Calculate expected costs and error counts for a group of cases
  • Explain how changing the threshold changes positive classifications and error types
  • Identify when the simple cost-based threshold does not apply

Why a Classification Threshold Is a Decision

A model may assign each case a probability of belonging to a positive class, but a probability is not itself a decision. A decision requires a rule for acting on that probability. For example, a hypothetical insurer might use predicted probabilities to flag applications for additional review. A low threshold flags more applications, including more cases that do not warrant review; a high threshold flags fewer cases, but may miss more cases that do. Which operating point is appropriate depends partly on the consequences of those two kinds of error.

The threshold should therefore be justified in terms of the decision and its costs, not described as a universal property of the model. The calculation below addresses a specific setting: two possible true states, two possible decisions, fixed costs for the two types of error, and no additional decision constraints.

Definition: In a binary classification problem, a false positive (FP) occurs when a case is classified as positive but its true state is negative. A false negative (FN) occurs when a case is classified as negative but its true state is positive. Let \(C_{FP}\) be the cost of a false positive and \(C_{FN}\) the cost of a false negative. In this tutorial, a correct classification has cost zero, and all costs are nonnegative.

For a case with estimated probability \(p\) of being truly positive, the two actions have different expected costs. Classifying the case as positive risks a false positive, while classifying it as negative risks a false negative. The word “expected” matters: before the true state is known, the cost is averaged over the possible true states using their probabilities.

Deriving the Cost-Based Threshold

Assume that \(p\) is a calibrated probability: among cases assigned probability \(p\), the long-run proportion that are truly positive is \(p\). Assume also that \(C_{FP}\) and \(C_{FN}\) apply to each case, correct classifications cost zero, costs add across cases, and there are no capacity limits or other decision constraints. Under these conditions, compare the expected cost of the two possible decisions for one case.

$$ \begin{aligned} \text{Expected cost if classified positive} &= C_{FP}(1-p),\\ \text{Expected cost if classified negative} &= C_{FN}p. \end{aligned} $$

The first expression uses \(1-p\), the probability that the case is actually negative; the second uses \(p\), the probability that it is actually positive. Choose the positive classification when its expected cost is no greater than the negative classification's expected cost:

$$ \begin{aligned} C_{FP}(1-p) &\leq C_{FN}p,\\ C_{FP} &\leq (C_{FP}+C_{FN})p. \end{aligned} $$

When \(C_{FP}+C_{FN}>0\), dividing by this positive sum gives the threshold. This derivation explains why the threshold depends on the relative error costs: making false negatives more costly lowers the threshold, while making false positives more costly raises it.

Result: If probabilities are calibrated, correct decisions have zero cost, false-positive and false-negative costs are fixed and nonnegative, and \(C_{FP}+C_{FN}>0\), a cost-minimizing rule is to classify a case as positive when \(p\geq t\), where $$ t=\frac{C_{FP}}{C_{FP}+C_{FN}}. $$ At \(p=t\), the two actions have equal expected cost, so either action is optimal for that case. If both error costs are zero, every decision has zero cost; the displayed formula is undefined and no particular threshold is required.

This rule is not automatically a rule for every model score. It applies directly to calibrated probabilities under the stated cost assumptions. A score that is only a ranking, or a probability that is not calibrated for the decision population, does not justify substituting that score into the formula without further support. Likewise, a binding review capacity or other constraint can change the decision problem, because the best choice for one case may then depend on the choices for other cases.

Worked Example: Applying the Cost Threshold to Four Cases

A hypothetical review team assigns four applications probabilities of positive status of 0.05, 0.20, 0.50, and 0.80. Suppose the probabilities are calibrated, a false positive costs $10, a false negative costs $90, correct classifications cost zero, and decisions have no other constraints. Find the threshold, classify each application, and calculate the total expected cost.

Method. Use the cost-based threshold, classify cases with \(p\geq t\) as positive, and calculate the expected cost for each selected action.

Step 1: Find the threshold. $$ t=\frac{10}{10+90}=0.1000. $$

Step 2: Apply the rule. The cases with probabilities 0.20, 0.50, and 0.80 are classified positive because each is at least 0.10. The case with probability 0.05 is classified negative. Thus, three of the four cases are classified positive.

Step 3: Calculate expected costs. For a positive classification, multiply $10 by the probability of being negative. For a negative classification, multiply $90 by the probability of being positive. $$ \begin{aligned} p=0.20 &: \quad 10(1-0.20)=10(0.80)=\$8.00,\\ p=0.50 &: \quad 10(1-0.50)=10(0.50)=\$5.00,\\ p=0.80 &: \quad 10(1-0.80)=10(0.20)=\$2.00,\\ p=0.05 &: \quad 90(0.05)=\$4.50. \end{aligned} $$ The total expected cost is \(8.00+5.00+2.00+4.50=\$19.50\).

Check. The decision for each case uses the lower of its two expected costs. For \(p=0.05\), classifying positive would cost \(10(0.95)=\$9.50\), more than the selected negative cost of $4.50. For \(p=0.20, 0.50,\) and \(0.80\), the positive decision costs $8.00, $5.00, and $2.00, respectively, each less than the corresponding negative-decision cost. The selections are therefore consistent with the threshold rule.

Common mistake avoided. Do not apply the false-positive cost to a case classified negative. The \(p=0.05\) case is negative, so its expected cost is \(90(0.05)=\$4.50\), not \(10(0.95)=\$9.50\).

From a Threshold to Case Volumes and Error Types

A threshold determines which cases receive positive classifications, but its consequences are usually reported in terms of both volume and errors. For cases with known probabilities, expected true positives, false positives, false negatives, and true negatives can be calculated by summing the relevant probabilities within the selected decision groups. These are expected counts, not guaranteed realized counts; actual outcomes can differ.

If a group contains \(n\) cases, each with probability \(p\), and all are classified positive, its expected true-positive count is \(np\), and its expected false-positive count is \(n(1-p)\). If the group is classified negative, its expected false-negative count is \(np\), and its expected true-negative count is \(n(1-p)\). The expected error cost is then \(C_{FP}\) times the expected false-positive count plus \(C_{FN}\) times the expected false-negative count.

Worked Example: Comparing Thresholds and Expected Workload

A hypothetical screening program has four groups of cases with calibrated probabilities. There are 100 cases at \(p=0.02\), 200 at \(p=0.08\), 300 at \(p=0.20\), and 400 at \(p=0.50\). A false positive costs $25 and a false negative costs $100. Correct decisions cost zero, and there is no capacity limit. Use the cost-based threshold to find the positive-classification volume, expected error counts, and expected cost. Then compare with a threshold of 0.08.

Method. First derive the cost threshold. Then apply the stated rule \(p\geq t\), multiply each group size by its probability or its complement to find expected counts, and add the two error costs.

Step 1: Find the cost-based threshold. $$ t=\frac{25}{25+100}=0.20. $$ With the convention \(p\geq t\), the groups at 0.20 and 0.50 are classified positive. Thus, \(300+400=700\) cases are classified positive, and 300 are classified negative.

Step 2: Calculate expected errors at threshold 0.20. Among the positive cases, the expected false positives are \(300(1-0.20)+400(1-0.50)=240+200=440\). Among the negative cases, the expected false negatives are \(100(0.02)+200(0.08)=2+16=18\). The corresponding expected true positives are \(300(0.20)+400(0.50)=60+200=260\), and expected true negatives are \(100(0.98)+200(0.92)=98+184=282\). The expected cost is $$ 440(\$25)+18(\$100)=\$11{,}000+\$1{,}800=\$12{,}800. $$

Step 3: Compare with threshold 0.08. Now the groups at 0.08, 0.20, and 0.50 are classified positive, so \(200+300+400=900\) cases are classified positive. Expected false positives are \(200(0.92)+300(0.80)+400(0.50)=184+240+200=624\). The 100 cases at 0.02 remain negative, giving \(100(0.02)=2\) expected false negatives. The expected cost is $$ 624(\$25)+2(\$100)=\$15{,}600+\$200=\$15{,}800. $$

Check. Lowering the threshold from 0.20 to 0.08 increases positive classifications by 200, adds 184 expected false positives and removes 16 expected false negatives. The cost change is \(184(\$25)-16(\$100)=\$4{,}600-\$1{,}600=\$3{,}000\), matching the difference between $15,800 and $12,800. At \(p=0.20\), the two actions tie in expected cost: \(25(0.80)=\$20\) if classified positive and \(100(0.20)=\$20\) if classified negative. Classifying that group positive is therefore allowed, but classifying it negative would have the same expected cost.

Ties, Operating Choices, and Reporting

A threshold gives a principled choice under explicit assumptions; it does not remove the need to describe what the rule means in practice. At the exact threshold, the two actions have the same expected cost. A reporting convention such as “classify positive when \(p\geq t\)” makes the case volume reproducible, but the equality case should not be presented as uniquely optimal. If a threshold is changed, report how many cases move between decisions and how the expected error types change, rather than saying only that sensitivity or accuracy “improves.”

Worked Example: Handling Cases Exactly at the Threshold

A hypothetical program has 80 cases at probability 0.10, 40 at probability 0.25, 50 at probability 0.40, and 30 at probability 0.80. Assume calibrated probabilities, a false-positive cost of $30, a false-negative cost of $90, zero cost for correct decisions, and no other constraints. Calculate the expected cost and expected error counts when cases at the threshold are classified positive. Then check the result if they are classified negative instead.

Method. Derive the threshold, calculate expected errors group by group, and compare the two possible decisions for the group exactly at the threshold.

Step 1: Find the threshold. $$ t=\frac{30}{30+90}=0.25. $$ The groups at 0.25, 0.40, and 0.80 are positive under the convention \(p\geq t\). This gives \(40+50+30=120\) positive classifications.

Step 2: Calculate expected error counts. The 80 cases at 0.10 are negative, giving \(80(0.10)=8\) expected false negatives. The expected false positives among positive groups are \(40(0.75)+50(0.60)+30(0.20)=30+30+6=66\). The expected cost is \(8(\$90)+66(\$30)=\$720+\$1{,}980=\$2{,}700\).

Step 3: Reverse the tie decision. If the 40 cases at 0.25 are classified negative, the positive volume is 80. That group adds \(40(0.25)=10\) expected false negatives, so expected false negatives total \(8+10=18\). Expected false positives are then \(50(0.60)+30(0.20)=30+6=36\). The expected cost is \(18(\$90)+36(\$30)=\$1{,}620+\$1{,}080=\$2{,}700\).

Check. For each case at \(p=0.25\), a positive decision has expected cost \(30(0.75)=\$22.50\), and a negative decision has expected cost \(90(0.25)=\$22.50\). The two tie choices therefore have equal expected cost, even though one classifies 40 more cases as positive and changes the expected error counts.

Common Traps in Threshold Justification

  • Reversing the error probability. For a positive classification, the false-positive probability is \(1-p\), not \(p\). For a negative classification, the false-negative probability is \(p\), not \(1-p\).
  • Treating a threshold as a model constant. The cost-based threshold depends on the stated error costs and assumptions. Different consequences can justify a different operating point for the same probabilities.
  • Reporting only the number classified positive. A change in case volume does not by itself describe the trade-off. State the expected or observed false-positive and false-negative consequences as appropriate.
  • Applying the formula to an uncalibrated score. The derivation uses probabilities that represent the chance of positive status. A ranking score alone does not have that interpretation.
  • Ignoring the assumptions behind the formula. Capacity constraints, costs for correct actions, case-specific costs, or non-additive consequences require a decision analysis that includes those features. The simple threshold need not minimize total cost in those settings.
  • Dividing by zero. The threshold formula requires \(C_{FP}+C_{FN}>0\). If both costs are zero, all decisions have zero error cost; a threshold is not selected by this calculation.
Key takeaway: Under calibrated probabilities, fixed nonnegative error costs, zero cost for correct classifications, and no additional constraints, compare \(C_{FP}(1-p)\) with \(C_{FN}p\). The resulting threshold is a decision rule tied to those assumptions. Explain its consequences through both the number of cases classified positive and the associated error costs.

Check Your Understanding

For each problem, use the stated convention that cases with \(p\geq t\) are classified positive unless the question asks about the tie choice.

  1. A case has calibrated probability \(p=0.15\). A false positive costs $40 and a false negative costs $160; correct decisions cost zero. Find the cost-based threshold and the lower expected cost for this case. (Answer: \(t=0.2000\); classify negative; expected cost \(160(0.15)=\$24.00\).)
  2. A hypothetical portfolio has 50 cases at \(p=0.10\), 100 at \(p=0.30\), and 50 at \(p=0.60\). With \(C_{FP}=\$15\) and \(C_{FN}=\$45\), find the threshold, positive-classification volume, expected false positives, expected false negatives, and total expected cost. (Answer: \(t=0.2500\); 150 positive classifications; 90 expected false positives; 5 expected false negatives; total expected cost \(90(15)+5(45)=\$1{,}575.00\).)
  3. A program has 120 cases at \(p=0.05\), 80 at \(p=0.25\), and 100 at \(p=0.50\). Let \(C_{FP}=\$10\) and \(C_{FN}=\$30\). Using \(p\geq t\), find the number classified positive, expected false positives, expected false negatives, and total expected cost. (Answer: \(t=0.2500\); 180 positive classifications; 110 expected false positives; 6 expected false negatives; total expected cost \(110(10)+6(30)=\$1{,}280.00\).)
  4. A screening group contains 200 cases at \(p=0.10\), 300 at \(p=0.20\), and 500 at \(p=0.40\). A false positive costs $12 and a false negative costs $48. Using the threshold rule with equality classified positive, calculate positive-classification volume and total expected cost. (Answer: \(t=0.2000\); 800 positive classifications; 540 expected false positives and 20 expected false negatives; total expected cost \(540(12)+20(48)=\$7{,}440.00\).)
  5. Suppose both \(C_{FP}\) and \(C_{FN}\) are zero. What does the cost comparison imply, and can the threshold formula be used? (Answer: Every decision has zero expected cost; the formula is undefined because its denominator is zero, and no particular threshold is required.)
Clinical Biostats