Classification Threshold Lab

Model Fitting Decision Thresholds

Discover why the default 50% decision cutoff almost never maximises profit in marketing. Set error costs and revenue, drag the threshold, and watch net profit rise — or fall — in real time.

👨‍🏫 Professor Mode: Guided Learning Experience

New to classification thresholds? Enable Professor Mode for step-by-step guidance through finding the profit-maximising threshold and understanding when the formula breaks down!

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—which is almost never true 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.50 or 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 (e.g., can only contact the top 15% of leads)?

📂 What Data You Need

  • Scored Holdout Dataset: Preset marketing cases (SaaS churn, B2B lead scoring, promo targeting) or uploaded CSV of actual (0/1) and predicted_prob
  • Payoff Matrix (Unit Economics): Net value of a True Positive (V_{TP}), cost of a False Positive (C_{FP}), and cost of a False Negative
  • Capacity Constraint (Optional): Maximum percentage or count of customers your team can contact

💡 What You'll Discover

  • Profit Curve & Optimal Cutoff T*: Expected net dollar payoff across every threshold from 0.01 to 0.99
  • Live Confusion Matrix & Metric Trade-Offs: How Precision, Recall, Specificity, and F1 shift as you drag T
  • Multi-Rule Comparison Table: Side-by-side profit and outreach volume at T* (Max Profit), Max F1, Max Youden's J, and T = 0.50
🔍 Key Nuances & Common Traps to Watch For
  • Why T = 0.50 Is Almost Always Wrong: If sending a $10 retention offer has a 30% chance of saving a $600 subscriber (expected TP benefit = $170) while wasting the offer on a loyal customer costs $10, you should contact anyone with churn risk above 10 / (170 + 10) ≈ 5.6%—not 50%!
  • Changing the Threshold Does Not Refit the Model: Dragging T moves 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*)

\[ \Pi(T) = N_{\text{TP}}(T)\cdot V_{\text{TP}} - N_{\text{FP}}(T)\cdot C_{\text{FP}} - N_{\text{FN}}(T)\cdot C_{\text{FN}}, \qquad T^* = \frac{C_{\text{FP}}}{V_{\text{TP}} + C_{\text{FP}}} \]

💬 Read it in plain English: Total campaign profit Π(T) sums the net gain from true positives minus the wasted outreach cost on false positives, and the marginal customer is worth contacting whenever their calibrated probability exceeds the cost-to-payoff ratio C_FP / (V_TP + C_FP).

T, T*
Decision Cutoff & Profit-Optimal T*YOUR DATA ⓘ
Probability threshold above which a customer is flagged positive (ŷ = 1), and the profit-maximizing cutoff.
NTP(T), NFP(T), NFN(T)
Confusion Matrix Counts at TOUTPUT ⓘ
Counts of True Positives, False Positives, and False Negatives produced at cutoff T.
VTP, CFP, CFN
Unit Economic Payoffs & CostsYOUR DATA ⓘ
Net dollar benefit of catching a true positive and unit costs of false-positive and false-negative errors.
Π(T)
Net Campaign Profit at Cutoff TOUTPUT ⓘ
Total expected dollar payoff across the scored cohort when operating at threshold T.

2. Precision, Recall (Sensitivity), F1 Score & Youden's J Statistic

\[ \text{Precision}(T) = \frac{\text{TP}}{\text{TP} + \text{FP}}, \qquad \text{Recall}(T) = \frac{\text{TP}}{\text{TP} + \text{FN}}, \qquad F_1(T) = \frac{2\cdot\text{Prec}\cdot\text{Rec}}{\text{Prec} + \text{Rec}}, \qquad J(T) = \text{TPR}(T) - \text{FPR}(T) \]

💬 Read it in plain English: Lowering T catches more true positives (higher Recall/TPR) at the cost of flagging more false alarms (lower Precision, higher FPR); F1 and Youden's J balance these rates without knowing dollar costs.

Precision(T)
Positive Predictive ValueOUTPUT ⓘ
Share of contacted customers at threshold T who are actual positive cases.
Recall(T) / TPR
Sensitivity / True Positive RateOUTPUT ⓘ
Share of all actual positive cases successfully caught at threshold T.
F1(T), J(T)
Harmonic Mean & Youden’s IndexINFERENCE ⓘ
Cost-agnostic statistical criteria balancing Precision/Recall (F₁) or Sensitivity/Specificity (J).
📚

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).

No file uploaded.

👆 Load a case study or upload your own scored dataset to begin the analysis.