Unit 3: Required
Topic | Description | Link |
---|---|---|
Lesson | Logistic Regression | Here |
Practice | Two activities: Bank Marketing and Multi-LogReg using Iris | Here |
Data | College Admissions Data, Titanic Survivors, Glass, and practice data | Here |
Slides | Sample Slides for Log Reg, Confusion Matrix, and ROC | Here |
Extra Materials | Examples of Logistic Regression Implementation | Here |
These datasets were chosen because they are familiar datasets from previous lessons and have binary targets for logistic regression.
After this lesson, students will be able to:
- Recall how to perform linear regression in scikit-learn.
- Demonstrate why logistic regression is a better alternative for classification than linear regression.
- Understand the concepts of probability, odds, e, log, and log-odds in relation to machine learning.
- Explain how logistic regression works.
- Interpret logistic regression coefficients.
- Use logistic regression with categorical features.
- Compare logistic regression with other models.
- Utilize different metrics for evaluating classifier models.
- Construct a confusion matrix based on predicted classes.
Before this lesson(s), students should already be able to:
- Load in and perform basic analysis and manipulation on data in Pandas
- Build and interpret a linear regression model
- Explain the basics of probability
- Distinguish between continuous and categorical variables
- Understand the bias-variance tradeoff and use confusion matrices to tune this balance
TOTAL (170 min)
- Refresher: Fitting and Visualizing a Linear Regression using scikit-learn (20 min)
- Refresher: Interpreting Linear Regression Coefficients (15 min)
- Predicting a Categorical Response (15 min)
- Using logistic regression for classification (10 min)
- Probability, odds ratio, e, log, and log-odds (30 min)
- Understanding e and the natural logarithm (20 min)
- The log-odds ratio (10 min)
- What is Logistic Regression? (10 min)
- Interpreting Logistic Regression Coefficients (20 min)
- Using Logistic Regression with Categorical Features (15 min)
- Comparing Logistic Regression to Other Models (10 min)
- Advanced Classifcation Metrics (25 min)
- Accuracy, True Positive Rate, and False Negative Rate (15 min)
- The accuracy paradox (10 min)
- OPTIONAL: How Many Samples Are Needed?
- Lesson Review
For more information on this topic, check out the following resources: