Logistic Regression, Interactively
Build intuition for logistic regression by training one live in your browser — adjust the learning rate, watch the decision boundary move, no backend required.
@shvinn
Machine Learning Engineer
Logistic regression is the simplest model that still teaches almost everything: a linear boundary, a nonlinear squashing function, and gradient descent.
The model
It predicts the probability of the positive class by passing a linear score through the sigmoid:
Training minimizes the binary cross-entropy loss by gradient descent.
Train it yourself
The playground below trains a logistic regression model entirely in your browser on a synthetic two-class dataset. Adjust the learning rate and epochs, hit train, and watch the decision boundary converge.
What to notice
- A too-high learning rate makes the loss bounce or diverge.
- A too-low rate converges slowly — many epochs for little progress.
- The boundary is always a straight line: logistic regression is linear in feature space. Curved boundaries require feature engineering or a nonlinear model.
This same training loop — forward pass, loss, gradient, update — is the kernel inside every deep network.