Classification: lesson 3 of 5
Classification
Probabilities, Thresholds, and Decision Boundaries
Show how converting probabilities into labels changes model behavior.
Concept
A classifier's probability-like output is not automatically a final class decision. A threshold converts a score into a label. With a threshold of 0.50, a model may predict positive when p >= 0.50 and negative otherwise. That familiar rule is a convention, not a universal best choice.
Probability Versus Class
Customer A may have predicted churn probability 0.82, while Customer B has 0.43. The first is estimated as higher risk, but whether either customer receives outreach depends on the threshold and the available action. A probability summarizes a model estimate; a class turns that estimate into an operational decision.
| Customer | Predicted churn probability | Label at 0.50 | Label at 0.30 |
|---|---|---|---|
| A | 0.82 | Churn | Churn |
| B | 0.43 | No churn | Churn |
| C | 0.28 | No churn | No churn |
Lowering the threshold labels more cases positive. Raising it labels fewer cases positive. Neither direction is automatically better because different mistakes have different costs.
Threshold Trade-Offs
A fraud team may use a lower threshold if missing fraud is costly and review capacity exists. A marketing team may use a higher threshold when outreach is expensive or limited. A medical screening system may favor identifying more possible cases, then use a follow-up test. Later lessons use precision and recall to quantify these trade-offs; the important idea now is that a threshold is a decision policy, not a model law.
Thresholds should be chosen using development/validation evidence and business context, not repeatedly adjusted after looking at final test performance. A high probability is not certainty, and a low probability does not guarantee an outcome will not occur.
Decision Boundaries
For one or two features, imagine a map of feature space. One region is labeled class 0 and another class 1. The dividing line or surface is the decision boundary. Logistic regression uses its weighted feature score and threshold to decide which side of the boundary a row falls on. Changing the threshold can shift that dividing boundary.
The geometry matters less than the intuition: the model creates a rule for separating classes from feature patterns. A boundary can be useful while still making mistakes near uncertain or overlapping regions.
Scores Are Not Always Perfectly Calibrated Probabilities
Some models output scores that rank cases well without matching real-world frequencies perfectly. Even probability-like outputs should be treated as estimates and checked against appropriate evaluation evidence. Calibration methods are a later topic; do not assume every 0.80 output means exactly eight of ten similar cases will occur.
Failure Signals
Common Mistakes
- Treating 0.50 as universally correct.
- Ignoring scores once labels are produced.
- Selecting a threshold repeatedly from final test results.
- Treating probability as certainty.
- Assuming a higher threshold always creates a better model.
Best Practices
State the positive class, decision action, capacity constraint, and error consequences before choosing a threshold. Review how many cases would be labeled positive at candidate thresholds. Preserve a protected test set for final evaluation.
Interview Perspective
Question: What happens when you lower a classification threshold? Answer: more cases are labeled positive because a smaller score is enough to cross the decision rule. What the interviewer is testing: whether you connect a model score to operational trade-offs. Follow-up: why is 0.5 not always best?
Practice Questions
- Which customers flip from negative to positive when a threshold changes from 0.50 to 0.30 in the table?
- Why might a fraud team choose a lower threshold than a marketing team?
- What does a decision boundary separate?
- Why should threshold choice avoid repeated final-test inspection?
- Does a probability of 0.95 guarantee a positive outcome? Why not?
Quick Quiz
- What does a threshold do? Answer: converts a score into a class decision.
- Does lowering a threshold usually label more cases positive? Answer: yes.
- Is 0.50 a universal rule? Answer: no.
Key Takeaway
Key Takeaways
Probabilities rank or estimate class likelihood; thresholds turn them into decisions. Threshold choice reflects business consequences and changes the decision boundary.
Next Lesson
Next, extend binary prediction to choosing among several possible classes.
Finish this lesson on your terms
Mark it complete when you have worked through the material and are ready to move on.