Logistic Regression
Definition
A linear binary classifier that models via the sigmoid of a linear combination of inputs; the building block of a neural network neuron.
Intuition
The sigmoid “squashes” the linear score into a probability in . Training maximizes the log-likelihood of the labels, which is equivalent to minimizing cross-entropy. Despite the name, logistic regression is a classifier, not a regressor.
Formal Description
Model:
Loss per example (binary cross-entropy):
Gradients:
The gradient has a clean form: residual × input.
Vectorized batch form (columns are examples):
Applications
- Baseline binary classifier for any task
- Direct interpretation as calibrated probabilities
- Each neuron in a sigmoid-activation network
- Output layer for binary classification problems
Trade-offs
- Linear decision boundary — underfits non-linear problems
- Assumes features are individually informative; correlated features can cause instability
- Sensitive to class imbalance (consider reweighting or focal loss)
- Easily extended to multi-class via softmax regression