Phase 1 continues. Last episode fit a line for regression; this one turns that same linear score into a classifier. Classification predicts a discrete category (usually with a probability), not a continuous quantity.
The machine: keep the linear score z = w·x + b, then squash it with the sigmoid σ(z) = 1/(1+e^−z) into a probability p = P(y=1|x). Invert it and you get the logit: log(p/(1−p)) = w·x + b, so logistic regression is linear in log-odds. Each weight is an odds ratio via e^(w_j), why banks and epidemiology still use it for interpretable reason codes.
Why not squared error: MSE on a sigmoid is non-convex with vanishing gradients on the worst mistakes. The right loss is log loss / binary cross-entropy, which is the negative log-likelihood of a Bernoulli model, classification's version of MSE-as-Gaussian-MLE. Its gradient collapses to the clean (p − y)·x, the same form as linear regression.
Also covered: the linear decision boundary (a hyperplane) and why logistic regression can't solve XOR; the from-scratch NumPy rebuild (swap identity→sigmoid, MSE→cross-entropy, keep the same update); L2/L1/elastic-net regularization and the perfect-separation blow-up; multiclass via one-vs-rest vs softmax; a light look at accuracy's trap on imbalanced data (full metrics next episode); history from Verhulst's 1838 growth curve to Berkson's "logit" (1944) and Cox (1958); and the punchline, logistic regression is one neuron.
Worked example: scikit-learn 1.9.0 LogisticRegression on Breast Cancer Wisconsin, with StandardScaler, predict_proba, decision_function, and coefficient reading.