10.10: Logistic Regression assessment

Learning objectives

  • Identify which metrics from linear regression can be extended to logistic regression and why

  • Assess a logistic regression model with a confusion matrix

  • Explain what an ROC curve shows and generate one in R

Classwise videos

If you have questions as you watch the videos, feel free to send me an email or slack message! I will address common questions at the beginning of class.

If you’d like to run the code yourself as you go through the lecture, you can download the pumpkin seeds dataset at this link. Note that the ROC curve on the last slide of the second video uses a model with only Area and Perimeter as predictors, but the confusion matrix is based on the model that was used in video 1, which uses Area, Perimeter, Major axis length, and Solidity as predictors.

Supplemental resource:

Resource on interpreting interactions

Textbook

ISLR doesn’t explicitly cover metrics for logistic regression, but section 4.4.2 describes some of the same concepts (confusion matrix, sensitivity and specificity, ROC curve). Start on page 148.

Application exercise

Groups for this week

Go through the logistic regression lab in ISLR: 4.7.1 and 4.7.2

Add: Generate the ROC curve