From the output of the logistic regression model implemented in the preceding section, it is clear that the model performs slightly better than random guessing. Such a model fails to provide value to us. In order to optimize the model, we are going to optimize the hyperparameters of the logistic regression model by using the GridSearchCV algorithm that we used in the previous chapter.
The hyperparameter that is used by the logistic regression model is known as the inverse regularization strength. This is because we are implementing a type of linear regression known as l1 regression. This type of linear regression will explained in detail in Chapter 5, Predicting Numeric Outcomes with Linear Regression.
In order to optimize the inverse regularization strength, or C as it is called in short, we use the following code:
#Building the model with L1...