Exercise

Logistic regression combined with SMOTE

In this exercise, you're going to take the Logistic Regression model from the previous exercise, and combine that with a SMOTE resampling method. We'll show you how to do that efficiently by using a pipeline that combines the resampling method with the model in one go. First, you need to define the pipeline that you're going to use.

Instructions

100 XP
  • Import the Pipeline module from imblearn, this has been done for you.
  • Then define what you want to put into the pipeline, assign the SMOTE() method to resampling, and assign LogisticRegression() to the model.
  • Combine two steps in the Pipeline() function. You need to state you want to combine resampling with the model in the respective place in the argument. I show you how to do this.