Lesson 2 of 6 10 min · 161 words
Logistic regression
A linear score passed through the sigmoid to get a probability.
Logistic regression models the probability of the positive class as a linear score passed through the sigmoid:
The sigmoid maps to , with , for large and for very negative . Its derivative is neat: .
Inverting gives the log-odds: . So each weight is the change in log-odds per unit of its feature; is the factor by which the odds multiply.
It is trained by minimising binary cross-entropy (equivalently, maximising likelihood). There is no closed form, but the loss is convex, so gradient descent finds the global optimum. The gradient is simply .
Formula to remember
Logistic model
Probability of the positive class.
Quick check · +5 XP