Logistic probabilities
The supplied logistic link maps a real linear score z to p=1/(1+exp(-z)).
On this page 9 sections
- Overview
- A logistic function turns an unrestricted scalar score into a number between 0 and 1
- At z=0, the exponential is 1, so p=1/(1+1)=0.5
- For an event score z=1+2x at x=1, first compute z=3
- Turning probabilities into class labels requires a separate decision threshold
- Key takeaway
- Further questions
- Sources & further reading
- Concept connections
01A logistic function turns an unrestricted scalar score into a number between 0 and 1#
A logistic function turns an unrestricted scalar score into a number between 0 and 1. In a binary prediction model, that number represents the forecast probability of the class labeled 1. The score may come from a weighted feature sum.
A score can be any real number. This curve maps it into a probability: score 0 lands at 0.5, with negative and positive scores on opposite sides.
The supplied logistic link uses the negative score inside the exponential. Add 1 in the denominator, then take the reciprocal.
At score , , so . At score using the natural logarithm, , so the probability is . A positive score therefore gives a probability above one half.
. . . Give to 3 decimals.
Show answer and explanation
.
02At z=0, the exponential is 1, so p=1/(1+1)=0.5#
At , the exponential is 1, so . At , use : . Reversing the score sign gives the opposite probability.
. . . Reported . Repair to 3 decimals.
Show answer and explanation
.
03For an event score z=1+2x at x=1, first compute z=3#
For an event score at , first compute . Then gives . Apply the link once to the complete score. Finite scores never give exactly 0 or 1.
Event score at . . ; ; . Give to 3 decimals.
Show answer and explanation
.
04Turning probabilities into class labels requires a separate decision threshold#
Turning probabilities into class labels requires a separate decision threshold. A forecast 0.75 does not guarantee this particular example belongs to class 1. Calibration and evaluation assess how such probabilities behave across cases.
Compute the full score, negate it inside the exponential, then take 1 divided by 1 plus that exponential.
- Convert a linear score to a probability through a supplied logistic link.
Further questions
Does this probability formula fit the model coefficients?
Sources & further reading
- [1]Penn State STAT 462, §12.1 Logistic Regression ↗Textbook · Book