Classification Threshold Lab
See why the default 50% decision cutoff rarely maximises profit in marketing. Set error costs and revenue, drag the threshold, and watch net profit rise or fall in real time.
OVERVIEW & WHAT THIS TOOL SOLVES
Every churn, lead-scoring, or fraud model outputs a continuous probability between 0 and 1, yet turning that score into an action list requires picking a decision threshold (T). Leaving the cutoff at the software default of 0.50 implicitly assumes a false positive costs the exact same dollar amount as a false negative, an assumption that rarely holds in marketing. The Classification Threshold Lab links confusion-matrix trade-offs directly to unit economics to find the exact profit-maximizing cutoff T*.
🎯 Questions It Answers
- What probability cutoff
T*maximizes net campaign profit given our outreach cost, save rate, and customer lifetime value? - How much money do we leave on the table if we use the default
T = 0.50or optimize a purely statistical metric like F1 or Youden's J? - What is the best threshold when our call center or sales team has a hard capacity cap (for example, it can make only 120 calls a week)?
📂 What Data You Need
- Scored Holdout Dataset: Preset marketing cases (subscription churn emails, telecom retention calls, B2B lead scoring) or an uploaded CSV with
predicted_prob(0 to 1) andactual_outcome(0/1) - Payoff Inputs (Unit Economics): Gross revenue per true positive (
R), action cost per contact (CFP) and the cost of a missed positive (CFN) - Capacity Constraint (Optional): The most customers your team can act on in the scored list, as a count
💡 What You'll Discover
- Profit Curve & Optimal Cutoff
T*: Net dollar payoff at every threshold from 0 to 1 - Live Confusion Matrix & Metric Trade-Offs: How Precision, Recall and Accuracy shift as you drag
T - Capacity Cutoff: The lowest threshold that keeps the list within your team's capacity, with its confusion matrix and profit
- Multi-Rule Comparison Table: Side-by-side outreach volume, confusion matrix, Precision, Recall, Accuracy, F1, Youden's J, and profit. Compares your current threshold,
T = 0.50, capacity cutoff, profit-maximisingT*, Max F1, and Max Youden's J.
🔍 Key Nuances & Common Traps to Watch For
- Why T = 0.50 Is Almost Always Wrong: Suppose a $10 retention offer has a 30% chance of saving a $600 subscriber ($170 expected TP benefit), while wasting it on a loyal customer costs $10. Contact anyone with churn risk above
10 / (170 + 10) ≈ 5.6%, not 50%. - Changing the Threshold Does Not Refit the Model: Dragging
Tmoves your operating point along the exact same ROC and Precision–Recall curves without changing customer rankings or AUC. - Calibration Prerequisite: The theoretical break-even threshold formula assumes your model's probabilities are calibrated to the true population rate (if you oversampled training data, recalibrate first in the Rare Event Calibration Lab).
📐 Under the Hood: Model Equations & Variable Definitions
1. Expected Campaign Profit Curve & Theoretical Break-Even Threshold (T*)
💬 Read it in plain English: Total campaign profit Π(T) equals the net gain from true positives minus wasted outreach cost on false positives (and any miss cost C_FN). Contact a customer whenever their calibrated probability exceeds C_FP / (V_TP + C_FP + C_FN). With the lab's inputs, V_TP = R − C_FP, which gives the C_FP / (R + C_FN) formula shown in Step 5.
2. Precision, Recall (Sensitivity), F1 Score & Youden's J Statistic
💬 Read it in plain English: Lowering T catches more true positives (higher Recall/TPR) at the cost of more false alarms (lower Precision, higher FPR). F1 and Youden's J balance these rates without using dollar costs.
Use a Case Study
Select a case study above to load data and see the business context.
Upload Your Data
Drag & Drop scored data file (.csv, .tsv, .txt, .xls, .xlsx)
Needs columns: predicted_prob (0–1 score) and
actual_outcome (0 = negative, 1 = positive).
👆 Load a case study or upload your own scored dataset to begin the analysis.
SEE YOUR DATA
Each dot is one customer. Top half = actual positives (the people you want to catch). Bottom half = actual negatives (the people you don't want to waste budget on). The model has given every customer a score between 0 and 1. Your job is to decide which score is the cutpoint for action.
Dots change colour as you move the threshold: Green TP = correctly flagged, Amber FN = missed, Red FP = false alarm, Grey TN = correctly ignored. Drag the blue handle to move the threshold. Once you press ⚡ Jump to Optimal T*, a gold dashed line marks the profit-optimal T*.
📊 How to Read This Chart
- Top half (Positives ↑): Actual positives stacked upward. Green = TP (caught), Amber = FN (missed). Aim for as many green dots as possible.
- Bottom half (Negatives ↓): Actual negatives stacked downward. Grey = TN (ignored, good), Red = FP (false alarm, costs budget). Keep red low.
- Drag threshold left → wider net → more green TPs but more red FPs. Drag right → fewer red FPs but more amber FNs missed.
- The gold dashed line marks T*, the profit-maximising threshold. It stays hidden until you click ⚡ Jump to Optimal T*, so you can predict it first.
- When N > 120, a representative sample is shown. Each dot stands for several real customers, so the colour pattern still reflects the full dataset.
MOVE THE LINE
The threshold is your decision rule. Drag it left and right to watch how the four quadrants of the confusion matrix fill and empty in real time. Every threshold sets a different policy for how much risk you will take on each type of error.
DECISION THRESHOLD
Customers with score ≥ threshold are flagged for action.
🤔 Try this: Drag to T = 0.20 and watch the confusion matrix: you catch more Green TPs, at the cost of many more Red FPs. Now drag to T = 0.80 and compare the drop in Red FPs against the rise in Amber FNs.
CONFUSION MATRIX
At your current threshold, predictions fall into four categories:
(Flagged) Predicted Negative
(Ignored)
Positive
Negative
SET THE STAKES
Error costs are rarely equal. An unnecessary email to the wrong customer costs $8 in send cost, whereas missing a churner you could have saved might cost $200 in lost lifetime value. Enter your unit costs (and optionally the gross revenue per successful intervention) to see the economics update live.
COST & REVENUE INPUTS
⚙️ Advanced: Intervention Flip Rate (α)
COST & PROFIT SUMMARY
Economic impact at your current threshold:
💡 How the Economics Work
- Cost-only (R = 0): CFP penalises every false alarm; CFN penalises every miss. The tool minimises total cost.
- With revenue (R > 0): R is gross revenue per true positive. CFP is charged on every flagged customer (TP and FP alike), so net value per TP = R − CFP. The tool maximises net profit.
- Flip rate (α): When only a fraction of your TPs actually change behaviour, effective revenue per TP = α × R. Lower α → T* rises.
FIND THE PEAK
The chart below plots your outcome metric across every possible threshold. When R = 0 it shows total cost, so seek the minimum. When R > 0 it switches to net profit, so seek the peak. The jump button moves the threshold directly to that optimal point.
After the jump, the green diamond ◆ marks T* (the optimal point). The purple dot ● is your current threshold.
📊 Reading the Curve
- Left end (T → 0): Flag everyone (zero FN, maximum FP waste).
- Right end (T → 1): Flag no one (zero FP, maximum FN losses).
- Cost mode (R = 0): U-shaped curve; minimum at T* = CFP / (CFP + CFN).
- Profit mode (R > 0): Inverted-U; maximum at T* = CFP / (R + CFN). Adding revenue pushes T* left, calling for a wider net.
- 💡 Case 3 insight: Cost-only gives T* ≈ 0.91. With $80K deal revenue, profit-max T* ≈ 0.10. Revenue transforms the strategy.
THE FORMULA REVEALED
The optimal threshold follows directly from an expected-value trade-off between acting and waiting. When the closed-form formula disagrees with your data's peak, the gap points to score miscalibration.
Predict where the optimum sits, then press ⚡ Jump to Optimal T* above: the optimal threshold, the formula and the calibration check appear here.
📐 The Derivation: Where T* Comes From
At any threshold T, a customer with true probability p generates either a correct decision or an error:
Expected cost of flagging (acting):
$$\text{E}[\text{cost} \mid \text{act}] = (1-p) \cdot C_{FP}$$Expected cost of not flagging (ignoring):
$$\text{E}[\text{cost} \mid \text{ignore}] = p \cdot C_{FN}$$Set them equal. The threshold where acting and ignoring cost exactly the same in expectation is T*:
Cost-only:
$$T^* = \frac{C_{FP}}{C_{FP} + C_{FN}}$$With Revenue (Profit-max):
$$T^* = \frac{C_{FP}}{R + C_{FN}}$$Act when: \(p \cdot R - C_{FP} > -p \cdot C_{FN}\) ⇒ \(p(R + C_{FN}) > C_{FP}\) ⇒ \(p > \dfrac{C_{FP}}{R + C_{FN}}\)
Generalised (Partial Flip Rate α):
$$T^* = \frac{C_{FP}}{\alpha \cdot R + C_{FN}}$$When only fraction α of flagged TPs actually change behaviour, effective revenue per TP = α·R. As α decreases, T* rises.
If \(C_{FP} \ll C_{FN}\) or R is large → \(T^*\) is small → cast a wide net.
If \(C_{FP} \gg R + C_{FN}\) → \(T^*\) is large → be very selective.
⚠️ Calibration caveat: This formula assumes scores are perfectly calibrated (the model's score equals the true probability the customer is positive). In real marketing data, raw scores rarely match true probabilities. Use the empirical T* (scanned from the net-profit curve, or the total-cost curve when revenue is $0) over the formula when they differ.
| Error Type | Who is Flagged? | Consequence | Cost |
|---|---|---|---|
| False Positive (FP) | Flagged as positive; actually negative | Wasted intervention on someone who didn't need it | \(C_{FP}\) |
| False Negative (FN) | Not flagged; actually positive | Missed opportunity, lost revenue, or undetected risk | \(C_{FN}\) |
WORK WITHIN CAPACITY & COMPARE RULES
Most teams cannot act on every customer the profit curve says is worth it. Enter how many your team can handle, and the lab finds the lowest cutoff that keeps the list within that number. The table then puts every rule side by side, on the same columns.
CAPACITY CONSTRAINT
The order of the scores decides which customers fill your capacity. The costs only decide what that list earns.
No capacity set. Enter the most contacts your team can handle for this list, and the lab finds the cutoff that fits.
MULTI-RULE COMPARISON TABLE
Each row is one decision rule, scored on the same data with the same costs. The highlighted row is your current slider position. The rows that give away the optimum (your data's T* and the formula values) appear after you press ⚡ Jump to Optimal T*, so you can predict them first.
| Rule | Cutoff | Flagged | TP | FP | FN | TN | Precision | Recall | Accuracy | F1 | Youden's J | Net Profit |
|---|
🔍 Reading Guide: Comparing Rules
- Max F1 and Max Youden's J ignore money. F1 balances Precision and Recall; Youden's J is Recall minus the false-alarm rate. Compare their profit with the profit-maximising row to see what a purely statistical rule costs you.
- Capacity binds when its cutoff sits above the profit-maximising T*. Then your team cannot reach everyone the economics would justify, and the capacity row is the plan you can actually run. When the capacity cutoff sits below T*, money is the limit, not capacity.
- Accuracy counts correct ignores too. When most records are negatives, a rule that flags no-one can score high accuracy while catching nobody. Read it next to Recall and Precision.
EXPLORE FURTHER
🤔 Work Through These
- The Default Trap: Load Case 2 (StreamFlow streaming service). What is net profit at the default threshold of 0.50? Now click ⚡ Jump to Optimal T*. How much additional profit do you capture? Why isn't the default threshold optimal?
- Cost Sensitivity: Load Case 1 (email retention, in cost-only mode with Revenue = $0). Double the FP cost from $8 to $16. What happens to the optimal threshold? In which direction does it shift? Why?
- Comparing Cases: Load all three case studies one at a time. Note the optimal threshold in each. What's the pattern? How do the cost and revenue parameters together determine where the profit-maximising threshold ends up?
- The Profit Curve: In Case 3 (B2B sales with $80K deal revenue), look at the net profit curve. Why does profit rise as the threshold lowers, then fall off? Where exactly is the peak, and does it match the profit formula? Now set Revenue = 0. How does the curve shape and optimal threshold change?
- Calibration Gap: Does the formula T* agree with the empirical T* on your data? If they differ significantly, what does that tell you about model calibration? Why does miscalibration matter more when the formula T* is very low (e.g., 0.05)?
- Operational Reality: In Case 3, the profit-optimal threshold is ~0.10. How many leads would you pitch at 0.10 vs. 0.50 vs. the cost-only threshold (~0.91)? If your team can only handle 20 pitches per quarter, does that constraint change your threshold choice?
📚 Connecting to the Bigger Picture
⚖️ Calibration in Marketing
Models trained on imbalanced marketing data (churn, response, conversion) are routinely miscalibrated. Always verify calibration before trusting the formula threshold directly.
📈 Precision-Recall Tradeoff
Every threshold shift moves precision and recall in opposite directions. Higher recall = more positives caught = lower threshold. Higher precision = fewer false alarms = higher threshold.
🔄 Re-evaluate Over Time
Costs change. An email that cost $8 to send today may cost $5 next year. The optimal threshold should be recalculated whenever cost assumptions change materially.
🎯 Beyond Binary Decisions
When you have multiple intervention tiers (low-cost email, medium-cost call, high-cost discount), you're no longer choosing one threshold but two or more. Expected-value optimisation extends naturally.