Module 10: Classification

Not every prediction is a number. This module shifts from predicting how much to predicting which category, starting with logistic regression β€” why linear regression breaks down for categorical outcomes, and how the logistic function fixes it. The evaluation chapter then confronts the most common trap in classification: a model can be 97% accurate and still be useless. You will learn to read a confusion matrix, choose metrics that match the cost of each kind of error, and use ROC curves to judge how well a model ranks risk.

Learning Objectives

By the end of this module, you will:

  • Explain why linear regression fails for classification and how logistic regression solves it
  • Interpret logistic regression coefficients in terms of log-odds, odds, and business impact
  • Build and compare logistic regression models with scikit-learn’s LogisticRegression
  • Make probability-based predictions and reason about the classification threshold
  • Recognize the accuracy trap and explain why accuracy misleads on imbalanced data
  • Construct and interpret confusion matrices, precision, recall, and F1-score
  • Use ROC curves and AUC to evaluate ranking quality
  • Select evaluation metrics based on the real-world cost of false positives and false negatives

Module Resources

Lecture

Resource Link
πŸ“Š Week 10 Slides View slides

Chapters & Notebooks

Each chapter has a companion Colab notebook with all the code from the chapter β€” ready to run, no installation required.

Chapter Topic Colab Notebook
23 Introduction to Logistic Regression Open in Colab
24 Evaluating Classification Models Open in Colab

Lab

Resource Link
πŸ§ͺ Lab 10: Classification Open in Colab

Reference

Resource Link
πŸ“‹ Module 10 Cheat Sheet View cheat sheet