As we’ve covered, logistic regression is used for classification when the outcome is categorical.

<aside> 💡

Binary logistic regression applies when there are two categories (e.g., pass/fail, yes/no, 0/1), while multinomial logistic regression handles three or more categories (e.g., car, bus, train).

</aside>

Binary Logistic Regression

In binary logistic regression, the model estimates the log odds of belonging to one category over the other using the formula:

$$ log \left(\frac{p}{1 - p}\right) = \beta_0 + \beta_1 x_1 + \dots $$

The output is a probability, which is converted into a class prediction using a threshold (usually 0.5). If p>0.5, the prediction is 1, otherwise 0. This is useful in cases like fraud detection or medical diagnosis.

Multinomial Logistic Regression

Multinomial logistic regression extends this to three or more categories, comparing each to a reference category. It estimates separate log odds equations, making it useful for customer segmentation, sentiment analysis, or species classification.

Unlike ordinal logistic regression, it does not assume any ranking between categories.


Next topic:

Model fitting