Logistic Regression Overview through 11 Practice Questions + Practice Notebook

Farzad Mahmoodinobar
13 min readOct 31, 2022

Overview

In this post we continue our journey of learning about Data Science Role Requirements by focusing on one of the most common machine learning classification models called Logistic Regression.

We are going to first learn what Logistic Regression is through a conceptual overview. Then we will start looking at the data which we will use to train a Logistic Regression model on. We will start with cleaning the data, then move on to building our model and then will look at various metrics that can be used in evaluating the performance of our trained Logistic Regression machine learning model, including accuracy, confusion matrix, precision, recall, Receiver Operating Characteristic (ROC) curve and area under the ROC curve (AUC).

Let’s get started!

Conceptual Overview

Logistic Regression, despite its name, is a classification algorithm where the dependent variable can only take two classes (e.g. yes vs. no or 0 vs. 1). Classification tasks with only two possible outcomes for the dependent variables are called binary classification, while classification tasks with more than two classes are called multi-class classification.

If you need a refresher on the distinction between regression and classification, feel free to visit this post.

Pro Tip: Although Logistic Regression is normally used for binary…

--

--