Scores, Probabilities, Labels, and First Thresholds
Unit ID: ML-M03-U05 Estimated active time: 25-35 minutes
Why this matters
A classifier often gives more than a final label.
It can also give a score or predicted probability.
The label is the decision the model reports. The probability is a measure the model uses before that label is chosen.
The idea
For a binary classifier, the model may estimate:
probability of class 1 = 0.73
If the default threshold is 0.50, then 0.73 becomes label 1.
If the probability is 0.31, it becomes label 0.
This does not mean the model knows the truth. It means the model estimated a score from the learned pattern.
Predict
With a default threshold of 0.50, what label comes from each probability?
| Predicted probability for class 1 | Label |
|---|---|
| 0.82 | |
| 0.47 | |
| 0.51 |
Answers: 1, 0, 1.
Run or inspect
In scikit-learn, many classifiers support:
predicted_probabilities = model.predict_proba(X_test)
For binary classification, this returns probabilities for class 0 and class 1.
In the first notebook, we inspect a few class-1 probabilities so learners can see how labels are created.
Change one thing
If the cost of missing a struggling learner were much higher than sending one extra support message, we might choose a lower threshold later.
But threshold tuning is not a Module 3 topic. It gets proper time in Module 6.
Practice
In the worked notebook:
- Inspect a few predicted probabilities.
- Convert them to labels with the default threshold.
- Compare the labels with the true target.
- Write one sentence about why probability is not certainty.
Check and explain
Complete:
A predicted probability is useful, but it is not ______.
Takeaway
Classifiers can produce probabilities and labels. Thresholds turn scores into labels, but threshold decisions need careful context.
