C.W.K.
Stream
Lesson 03 of 05 · published

Probability vs Likelihood: The Distinction Worth Knowing

~8 min · probability, likelihood, MLE

Level 0Math Novice
0 XP0/59 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

Two Words That Aren't Synonyms

In casual English, "probability" and "likelihood" mean the same thing. In statistics they don't, and the distinction matters.

QuestionVariable
Probability Given parameters , how likely is the data ?data varies, parameters fixed
Likelihood Given the data , how plausible are the parameters ?data fixed, parameters vary

Same formula, different perspective. Probability looks forward (model → data); likelihood looks backward (data → model).

Why ML Cares

Maximum Likelihood Estimation (MLE) is the foundation of model training. The principle: the best parameters are the ones that make the observed data most plausible. Mathematically: . In practice you minimize negative log-likelihood, which is what cross-entropy loss really is.

Every time you train a classifier, you're solving an MLE problem in disguise.

Softmax: Logits → Probability Distribution

Neural network classifiers output raw scores called logits. To turn them into probabilities (non-negative, summing to 1), apply softmax:

Subtracting for numerical stability before exponentiating is now standard.

Probability fixes the model and varies the data. Likelihood fixes the data and varies the model. Training is searching parameter-space for the model that makes the data most plausible.

Code

Softmax — logits to probabilities·python
import numpy as np

def softmax(logits):
    shifted = logits - logits.max()        # stability
    exp = np.exp(shifted)
    return exp / exp.sum()

logits = np.array([2.0, 1.0, 0.5, -1.0])
probs = softmax(logits)
print(probs)                                # [0.620, 0.228, 0.139, 0.013]
print(probs.sum())                          # 1.0 — proper distribution

External links

Exercise

Take logits [3.0, 1.0, 0.0]. Apply softmax. Then add 1000 to every logit and apply softmax again. Why is the result the same? What does this tell you about absolute logit values?
Hint
Softmax is invariant to constant shifts: softmax(x + c) = softmax(x) because the constant cancels. Only the *differences* between logits matter, not their absolute values.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.