Experiments / live

Logistic regression playground

Two classes strung out along one axis — class 0 down low, class 1 up high — and a sigmoid fitted through them by gradient descent on the cross-entropy loss. Slide the classes apart and the curve steepens: far from the boundary the model is emphatically sure, and the steepness a climbs. Overlap them and it flattens, hedging its bets while the cross-entropy readout rises. The gold dashed line is the decision boundary — the single point where the S-curve crosses 0.5, i.e. where x·a + b = 0. For all the curve's bending, the verdict is a flat cut. The full story — log-odds, the Bernoulli likelihood, and that clean gradient — is in the essay.

fitted probability curve

p(x) = σ(a·x + b)