Foundations · /logistic

Logistic regression

A linear score z pushed through the sigmoid. The heatmap is the model's probability; the arrow is the weight vector, always perpendicular to the boundary. Hover w₁ in the formulas and watch the arrow answer.

class 0class 1filled = train, hollow = testhover to probe · click to pin
step 0BCE train acc test acc

Data

datasetpoints150noise0.15seedsplitmouse
Linear score
Sigmoid
The decision boundary is the line where z = 0, i.e. p = 0.5.
Binary cross-entropy
Gradient
What's simplified here
  • Full-batch gradient descent only — no momentum, no second-order methods.
  • Two features and two classes; multinomial softmax is out of scope for this page.