Databases Reference
In-Depth Information
The Underlying Math
So far we've seen that the beauty of logistic regression is it outputs
values bounded by 0 and 1; hence they can be directly interpreted as
probabilities. Let's get into the math behind it a bit. You want a function
that takes the data and transforms it into a single value bounded inside
the closed interval
0, 1
. For an example of a function bounded be‐
tween 0 and 1, consider the inverse-logit function shown in
Figure 5-2
.
e
t
1 +
e
t
1
1 +
e
−
t
P t
= logit
−1
t
≡
=
Figure 5-2. The inverse-logit function
Logit Versus Inverse-logit
The logit function takes x values in the range
0, 1
and transforms
them to y values along the entire real line:
p
1−
p
logit p
=
log
=
log p
−
log
1−
p
The inverse-logit does the reverse, and takes x values along the real
line and tranforms them to y values in the range
0, 1 .
Note when
t
is large,
e
−
t
is tiny so the denominator is close to 1 and
the overall value is close to 1. Similarly when
t
is small,
e
−
t
is large so