AI Logistic Regression Tutorial: Binary Classifier
TL;DRLogistic 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.
Key points
Linear model → sigmoid → probability
Threshold the probability for a class
Interpretable, fast classification baseline
Multi-class via softmax
Common mistakes
Thinking it does regression (it classifies)
Ignoring class imbalance and threshold choice
Assuming linear decision boundary always fits
Try it: Explain 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>