Logistic Regression
Turn a weighted sum into a probability with the sigmoid, train it with log loss, and choose a decision threshold.
From numbers to categories
Linear regression predicts any number. For classification with two classes (spam or not, 1 or 0) we want a probability between 0 and 1. Logistic regression does this in two steps:
- Compute a score as before: . This can be any real number.
- Squash it into with the sigmoid function:
The output is read as "the probability the label is 1".
Despite the name, it is a classification model. "Regression" is historical: it regresses the score .
1 of 7