Concepts / Predicting Probabilities

Predicting Probabilities

In binary classification the class probabilities sum to 1, so exactly one class is above 50% and that class is the predicted one.

  • Programming

A Tempting Belief About Confident Models

A common assumption about classifiers goes like this: when a model reports that it is very certain about a prediction, that prediction is probably right, and the more certain the model sounds, the more trustworthy it is. This sounds reasonable, but it quietly mixes two separate questions. The first question is what the model says about its own confidence. The second is how often the model is actually correct when it says that. This article follows the gap between those two questions and the property that closes it, which is called calibration.

What do you think happens?

A binary classifier reports P(class A) = 0.72 and P(class B) = 0.28 for one input. Which class does the model predict?

  • Class A

  • Class B

Reveal answer
Answer:

Class A

The two class probabilities of a binary classifier add up to 1, so exactly one of them is above 50%. Here 0.72 is above 50%, so class A is the predicted class. The predicted class is simply the one carrying the larger share of the probability.

What Calibration Actually Requires

Definition

A model is calibrated when its reported uncertainty matches how correct it is: a prediction made with 70% certainty should be correct about 70% of the time across such predictions.

Read the requirement in words: among all the predictions where the model reports confidence p, the fraction that turn out correct should be p. The claim is about a group of predictions that share the same stated confidence. A single prediction made at 70% confidence can be right or wrong, and calibration says nothing about that one outcome. It describes what happens across many predictions made at that confidence level.

Rule

Stated confidence 70%Across a group ofpredictionsObserved correctabout 70%Calibrated for that groupStated confidence 40%Across a different groupObserved correctabout 55%Not calibrated for thatgroupshould matchshould match
When the model reports 70% confidence across many predictions, is it correct about 70% of the time? Calibration holds only when the two columns match.

Tracing Probabilities in a Binary Problem

Classifiers that expose uncertainty estimates give a probability for each class. In a binary problem with two classes, those two probabilities add up to 1: $P(\text{class A}) + P(\text{class B}) = 1$. Because they must sum to 1, exactly one class is above 50% and that class is the predicted one. The other class is necessarily below 50%.

Class A: 0.72Predicted classClass B: 0.28Not predicted
With P(class A) = 0.72 and P(class B) = 0.28, only class A sits above the 50% line, so only class A is predicted.
Worked example

Choosing the predicted class from two probabilities

A binary classifier gives P(class A) = 0.72 and P(class B) = 0.28 for one input. Which class is predicted?

  1. 1
    Check the sum

    0.72 + 0.28 = 1.00, so the two probabilities are a valid pair for a binary problem.

  2. 2
    Find the class above 50%

    Class A is at 0.72, which is above 50%. Class B is at 0.28, which is below 50%.

  3. 3
    Select the predicted class

    Exactly one class is above 50%, and that class is the one predicted. Class A is predicted.

Result

The model predicts class A. Its stated confidence in that prediction is 72%, which is not the same as a guarantee that the prediction is right.

The source also describes how this plays out across a whole dataset. In its example the classifier is relatively certain for most points, so most points sit comfortably on one side of 50%. That overall picture tells you how the model is behaving, but it does not by itself tell you whether the certainty is deserved. Whether the reported uncertainty reflects real uncertainty in the data depends on the model and its parameters.

Reading Multiclass Probabilities

Everything so far concerned binary classification. The decision_function and predict_proba methods also work in the multiclass setting, where there are more than two classes. The source illustrates this on the Iris dataset, a three-class problem. Both methods provide uncertainty estimates in binary and multiclass settings, but they report those estimates in different forms. The source does not say what those forms are beyond this, so the reading below focuses on the probabilities themselves.

ClassProbabilityAbove the most likely rival?
Class A0.15No
Class B0.61Yes, the highest value
Class C0.24No

A hypothetical three-class output for one input. The probabilities sum to 1, and the largest value identifies the predicted class.

In the multiclass case, the predicted label is the class with the highest probability. The 50% test used in the binary case does not carry over directly, because with three classes the top probability may fall below 50% while still being the largest. In the table above, class B at 0.61 is the predicted class even though the next class is at 0.24. Identifying the predicted class is a matter of comparing values, not of checking a single threshold.

Complexity, Overfitting, and Certainty

The source ties the reliability of a model's uncertainty to its complexity, and it makes two claims that point in opposite directions. First, a model that is more overfitted tends to make more certain predictions, even if those predictions might be wrong. Second, a model with less complexity usually has more uncertainty in its predictions. Both claims matter when you read a model's reported confidence.

More overfittedmodelFits training data closelyMore certainpredictionsHigh stated confidenceConfidence may bemisplacedPredictions can be wrongLess complex modelSimpler fitMore uncertaintyPredictions spread outtends to produceeven when wrongusually shows
A more overfitted model tends toward certain predictions that can be wrong, while a less complex model usually shows more uncertainty.

This matters for calibration because an overfitted model can look confident for the wrong reason. Its high certainty reflects how closely it has fit the training data, not necessarily how often it will be right on new inputs. So certainty alone cannot be read as calibration. A calibrated model's stated confidence has to line up with how often it is correct, and an overfitted model can report high confidence while that alignment fails.

Where the Belief Breaks Down

The belief that high confidence means a good model separates from calibration at one specific step: when the stated confidence is treated as a verified claim without checking it against observed outcomes. The first question asks what the model says about its confidence. Calibration asks the second question, namely whether the model is correct about as often as it says across predictions made at that confidence. Only the second question establishes that the stated confidence means anything.

  • Common mistake

    Treating a high confidence score as proof that a prediction is right

    What it looks like

    A model reports 95% confidence on a prediction, so the prediction is assumed to be correct.

    Why it fails

    Calibration is a statement about many predictions that share a confidence level. A single high score does not establish that the model's confidence matches how often it is correct.

    Do this instead

    Ask how often the model is correct across all predictions that carry that confidence level.

  • Common mistake

    Assuming an output called a probability is automatically calibrated

    What it looks like

    Because predict_proba returns class probabilities, its numbers are assumed to match observed frequencies.

    Why it fails

    The source states that providing an estimate does not by itself guarantee calibration, and it does not claim that either method's output is calibrated.

    Do this instead

    Check calibration as a separate question, by comparing stated confidence with observed correctness.

  • Common mistake

    Reading a model's certainty as evidence that it generalizes well

    What it looks like

    An overfitted model makes very certain predictions, so it is judged more reliable than a simpler model.

    Why it fails

    The source says overfitted models tend to make more certain predictions even when they are wrong, while less complex models usually show more uncertainty.

    Do this instead

    Treat high certainty from a heavily fitted model with caution, and check whether its confidence lines up with observed correctness.

  • Common mistake

    Applying the 50% rule to every multiclass prediction

    What it looks like

    With three classes at 0.35, 0.40 and 0.25, the top class is dismissed because it is below 50%.

    Why it fails

    The above-50% argument relies on two binary probabilities summing to 1. In the multiclass case the predicted class is the one with the highest probability.

    Do this instead

    Select the class with the largest probability, and do not use a single 50% cutoff with more than two classes.

Practice Reading Confidence

MEDIUM

A three-class classifier reports probabilities 0.35 for class A, 0.40 for class B and 0.25 for class C on one input. Which class is predicted? Then explain why the 50% rule from the binary case does not decide this prediction. Finally, suppose a model made 100 predictions at 70% stated confidence and 52 were correct. Is it calibrated for that confidence level?

Hints
  • In the multiclass case, compare the values and select the largest one.
  • Binary probabilities sum to 1 and exactly one is above 50%. Here no class is above 50%, so that rule cannot decide the prediction.
  • Calibration says about 70% of predictions at that confidence should be correct. Compare 52 out of 100 with 70 out of 100.

Key Takeaways

  • Calibration means that among predictions made with stated confidence p, the fraction correct should be p, and it is a property of many predictions rather than one.
  • In a binary problem the two class probabilities sum to 1, so exactly one class is above 50% and that class is predicted; in the multiclass case the predicted class is the one with the highest probability.
  • An overfitted model tends to make more certain predictions even when they are wrong, while a less complex model usually shows more uncertainty, so certainty alone is not evidence of reliability.
  • Providing predict_proba or decision_function output does not by itself guarantee calibration, which must be checked by comparing stated confidence with observed correctness.

Related concepts

More concepts starting with P