How it works...
This recipe shows how easy it is to use different classifiers, as long as we want to use the default settings. In the first step, we imported the classifiers from their respective libraries.
In Steps 2 to 5, we created a special pipeline for each classifier. We combined the already established ColumnTransformer preprocessor with the corresponding classifier. Then, we fitted each pipeline to the training data and showed the performance evaluation report.
Classifiers such as XGBoost and LightGBM offer their own approaches to training models. First, you need to convert the pandas DataFrame to an acceptable data format (xgb.DMatrix, in the case of XGBoost, and lightgbm.Dataset for LightGBM), then use the train and cv functions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access