1. Learn
  2. /
  3. Courses
  4. /
  5. Machine Learning with Tree-Based Models in Python

Exercise

Define the bagging classifier

In the following exercises you'll work with the Indian Liver Patient dataset from the UCI machine learning repository. Your task is to predict whether a patient suffers from a liver disease using 10 features including Albumin, age and gender. You'll do so using a Bagging Classifier.

Instructions

100 XP
  • Import DecisionTreeClassifier from sklearn.tree and BaggingClassifier from sklearn.ensemble.

  • Instantiate a DecisionTreeClassifier called dt.

  • Instantiate a BaggingClassifier called bc consisting of 50 trees.