Logistic regression: from linear score to probability to decision.
Logistic regression is the bridge from regression thinking to classification. It starts with a linear score, converts it into a probability, learns using log loss, and makes decisions using a threshold.
Teaching story
Opening question
If linear regression predicts 1.3 for “spam” and -0.2 for “not spam,” what should those numbers mean?
This motivates the need for probabilities between 0 and 1.
Session roadmap
Classification setup
Binary targets, examples, why linear regression is not enough, and the goal of predicting \(P(y=1\mid x)\).
2Sigmoid and boundary
Linear score, sigmoid function, probability threshold, and decision boundary.
3Loss and training
Why not MSE, binary cross entropy, cost function, gradient, and gradient descent.
4Interpretation
Log-odds, odds ratios, coefficient meaning, regularization, and multiclass extension.
5Evaluation
Confusion matrix, accuracy, precision, recall, F1, ROC-AUC, PR-AUC, threshold tuning, and imbalance.
6Handling imbalance
Threshold tuning, class weights, oversampling, undersampling, SMOTE, stratification, and business-aware model selection.