January 2020
Beginner to intermediate
432 pages
11h 24m
English
We can also create a grid containing multiple classifiers. To do so, we first import another classifier from scikit-learn, the logistic regression classifier:
from sklearn.linear_model import LogisticRegression
Again, we need to define the parameter grid. This time, it is a list containing multiple dictionaries—one dictionary per classifier. The hyperparameters for the decision tree are the same as before, and we do not explore the meaning of the logistic regression's hyperparameters. One extra thing worth mentioning is that, if we want to tune some other hyperparameters in the Pipeline, we need to specify them in each of the dictionaries in the list. That is why 'preprocessor__numerical__outliers__n_std' is included twice: ...
Read now
Unlock full access