1. Learn
  2. /
  3. Courses
  4. /
  5. Ensemble Methods in Python

Connected

Exercise

Bagging: the scikit-learn way

Let's now apply scikit-learn's BaggingClassifier to the Pokémon dataset.

You obtained an F1 score of around 0.63 with your custom bagging ensemble.

Will BaggingClassifier() beat it? Time to find out!

Instructions

100 XP
  • Instantiate the base model, clf_dt: a "restricted" decision tree with a max depth of 4.
  • Build a bagging classifier with the decision tree as base estimator, using 21 estimators.
  • Predict the labels of the test set.