A classifier never outputs a hard yes/no — it outputs a score, and a business chooses where to cut it. Two populations (e.g. "will churn" vs. "won't churn") each produce a roughly Gaussian score, overlapping in the middle. For a threshold t:
TP-rate(t) = 1 − Φ((t−μ₁)/σ₁) [catch positives above t]
FP-rate(t) = 1 − Φ((t−μ₀)/σ₀) [wrongly flag negatives above t]
Expected profit(t) = p·TPrate(t)·Benefit
− (1−p)·FPrate(t)·CostFP
− p·(1−TPrate(t))·CostFN
where Φ is the normal CDF and p is the base rate of the positive class. The threshold that maximizes this expression is not 0.5 unless the costs happen to be symmetric — a cheap intervention with an expensive miss pushes the optimum down; an expensive, disruptive intervention pushes it up. This is the exact expected-value framework used in real churn-prevention, fraud-review and credit-approval systems (Provost & Fawcett's "Data Science for Business" calls it cost-sensitive decision making).
- Threshold slider — moves the green line; everything to its right is classified "positive" and acted on.
- Prevalence slider — the 2D version exposes p directly (the 3D original fixed it at 30%); a rarer positive class shifts the optimal cutoff even with unchanged costs.
- Benefit / cost sliders — the payoff matrix a real business would plug in (customer value saved, review-team cost, lost-customer cost…).
- Jump to Optimal Threshold — scans the profit curve and snaps to its true maximum for the current costs and prevalence.
- The gold curve is expected profit re-computed at every possible threshold; its peak moves the moment you change a cost or prevalence slider.