← ~/visualizations

logistic-regression

Visualizes the logistic regression pipeline for a single example: a linear score z = w·x is accumulated term-by-term (including bias), mapped through the sigmoid curve to a probability p, then converted into a per-example binary cross-entropy loss. A bottom panel shows the 2D decision boundary (z=0) and a coarse probability field that updates as weights and the example point change over time.

canvasclick to interact
t=0s

practical uses

  • 01.Spam vs. not-spam classification from email features
  • 02.Medical risk prediction (e.g., disease present vs. absent)
  • 03.Click-through rate prediction (clicked vs. not clicked)

technical notes

Pure Canvas2D, green-on-black blocky style using grid snapping. Time-based cycling: weights and the displayed sample interpolate every ~0.9s; full cycle ~3.6s. Sigmoid and cross-entropy are plotted with stable clamped logs; decision boundary is drawn from z=0 in feature space; probability field rendered as coarse cells for a retro aesthetic.