logistic regression
/ luh-JIS-tik ree-GRESH-un /
Despite the name, logistic regression is a classifier — it answers yes-or-no questions rather than predicting a raw number. Will this email be spam? Will this patient relapse? Will this customer click? Instead of guessing a flat "yes" or "no," it returns a probability between 0 and 1, like "there's an 83% chance this is spam." That hedged answer is often far more useful than a blunt verdict, because you can choose your own threshold for acting on it.
Under the hood it starts exactly like linear regression — a weighted sum of the inputs — but then squashes that sum through an S-shaped curve called the logistic (or sigmoid) function, which gently bends any number, however large or small, into the 0-to-1 range. Far on one side it saturates near certainty (0.99), far on the other near impossibility (0.01), and in the murky middle it changes fastest. The weights are tuned so the predicted probabilities best match the true yes/no labels in the training data.
It earns its keep by being fast, sturdy, and interpretable: each weight tells you which way a feature tips the odds and how hard. It is a standard first try in medicine, credit scoring, and marketing, and a baseline that more elaborate models should be made to beat. The catch is the same as its cousin's — it draws a straight boundary between classes, so if the real dividing line is curvy it will struggle unless you hand-craft cleverer features.
A clinic predicts diabetes risk from one number, fasting glucose. Logistic regression learns an S-curve: at glucose 90 it outputs 5% risk, at 126 it crosses 50%, at 200 it reads 95%. The doctor sets the alarm threshold at, say, 30% — a choice separate from the model itself.
The same weighted sum as linear regression, bent through an S-curve into a probability.
It says "regression" but does classification — a perennial source of confusion. Also remember its probabilities are only as honest as your data: train it on a skewed sample and the percentages, however confident they look, will be skewed too.