Curvingo · Made in India

Glossary

Select one of the keywords on the left…

Logistic RegressionSummary

Reading time: ~5 min

One page to revise from — the ideas first, then every formula you need.

  • Classification predicts a group, not a number. Binary classification picks between two groups, written 1 and 0.
  • A straight line cannot give chances: it escapes below 0 and above 1. Logistic regression squashes the line z = wx + b with the sigmoid, so every output is a chance between 0 and 1.
  • A threshold turns a chance into a decision; the feature value where the chance equals the threshold is the decision boundary. Moving the threshold trades one kind of mistake for another.
  • Log-loss charges -\ln of the chance given to what really happened: right and sure costs almost nothing, wrong and sure costs a lot.
  • The best curve is found by gradient descent on the log-loss — or, equivalently, by maximum likelihood.
  • Odds are p \div (1 - p). One more unit of a feature multiplies the odds by e^w.

The model
p = \sigma(wx + b) = \dfrac{1}{1 + e^{-(wx + b)}}

Odds
\text{odds} = \dfrac{p}{1 - p}, \qquad \text{odds} \times e^{w} \text{ per unit of } x

Log-loss
-\dfrac{1}{n} \sum \Big[ y_i \ln p_i + (1 - y_i) \ln (1 - p_i) \Big]

Sina