The Classification Threshold
What you'll learn: How choosing a threshold value converts probability predictions into final class decisions, and why this choice matters for your model's behavior.
From Probabilities to Decisions
In the previous lesson, you learned that classification models like logistic regression output probabilities between 0 and 1. But to make a final prediction (e.g., "spam" or "not spam"), you need to draw a line somewhere. That line is called the classification threshold.
The Default: 0.5
By default, most binary classifiers use 0.5 as the threshold:
- If predicted probability ≥ 0.5 → predict positive class (1)
- If predicted probability < 0.5 → predict negative class (0)
This seems fair and balanced, right? But 0.5 isn't always the best choice for your specific problem.
Why the Threshold Matters
Think of a spam filter versus a medical diagnosis system:
- Spam filter: You might set threshold = 0.3 (lower). Better to catch more spam even if a few legitimate emails get filtered.
- Disease diagnosis: You might set threshold = 0.7 (higher). Only flag cases where you're very confident to avoid false alarms.
Changing the threshold creates trade-offs:
- Lower threshold (e.g., 0.3): Catch more positive cases, but also more false positives
- Higher threshold (e.g., 0.7): Fewer false positives, but you'll miss more true positives
Choosing Your Threshold
The right threshold depends on:
- The cost of different types of errors in your domain
- Whether false positives or false negatives are more harmful
- Business requirements and user expectations
You're not stuck with 0.5—you can tune this based on what matters most for your application.
Key Takeaway: The classification threshold (typically 0.5) converts probability predictions into binary decisions, and adjusting it lets you balance the trade-off between catching more positives versus avoiding false alarms.