freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #13 of 120

logistic regression · binary classifier

NeuraVSThe Overfit Ogre
Neura saysLogistic regression predicts a probability for classification — despite the name.

It takes a linear combination of features and squashes it through a sigmoid into a 0-1 probability, then thresholds for a class. It's the workhorse binary classifier: interpretable, fast, well-calibrated, a strong baseline. "Regression" in the name refers to the underlying linear model; the task is classification. Extend to multi-class with softmax.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleExplain how the sigmoid turns a score into a probability.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>score = w·x + b → sigmoid → 0.83 probability
≥ 0.5 → class A, else class B</pre></body></html>
▶ Open the interactive comic issue
‹ Linear Regression · The Simplest ModelDecision Trees · Gini · Entropy ›