Click to add labeled points and watch logistic regression fit an S-curve decision boundary through gradient descent.
Click along the chart's x-axis to add points of the selected class (single feature, binary classification).
Despite the name, logistic regression is a classification algorithm, it predicts which of two classes a point belongs to, not a continuous number. It gets its confusing name because, underneath, it starts with the same linear combination of inputs used in linear regression (w×x + b), but then passes that value through a sigmoid function, squashing it into a range between 0 and 1 that can be interpreted as a probability. The S-shaped orange curve in the visualization above is exactly this sigmoid function, and the model classifies any point as Class 1 if the curve's value at that point exceeds 0.5, and Class 0 otherwise.
Notice the curve is flat near 0 and flat near 1, but steep in the middle, this shape reflects genuine uncertainty near the decision boundary and confidence far from it. A point far to the left gets a prediction very close to 0 (confidently Class 0), a point far to the right gets a prediction very close to 1 (confidently Class 1), and points near the boundary get predictions close to 0.5, genuine uncertainty, which is exactly the behavior you'd want from a probability estimate, not just a hard yes/no answer.
This model trains using log loss (also called binary cross-entropy, covered in more depth in our Cross-Entropy Loss content), not the mean squared error used in the Linear Regression visualizer. Log loss penalizes confident wrong predictions extremely heavily, a prediction of 0.99 for a point that's actually Class 0 contributes a large loss, appropriately punishing overconfident mistakes, this asymmetric penalty is exactly matched to what you want from a probability-outputting classifier, and it also produces better-behaved gradients for optimization than squared error would for this type of sigmoid-based model.
Click "Train" repeatedly and watch the S-curve steepen and shift to more cleanly separate the two classes, this steepening reflects the model becoming more confident, gradient descent is adjusting the weight (which controls the curve's steepness) and bias (which controls its horizontal position) to minimize log loss across all the training points. If your two classes overlap significantly on the x-axis, you'll notice accuracy plateaus below 100%, no amount of training can perfectly separate classes that genuinely aren't linearly separable in the feature space you've given the model.
This demo uses a single input feature for visual clarity, real logistic regression applications typically use many features simultaneously (predicting loan default risk from income, credit history, and debt ratio together, for example), but the core mechanism, a weighted sum passed through sigmoid, trained via gradient descent on log loss, remains exactly the same regardless of how many input features are involved.