BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Machine Learning with Tree-Based Models in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

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

  • Instantiate a DecisionTreeClassifier called dt.

  • Instantiate a BaggingClassifier called bc consisting of 50 trees.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import DecisionTreeClassifier
____

# Import BaggingClassifier
____

# Instantiate dt
dt = ____(random_state=1)

# Instantiate bc
bc = ____(base_estimator=____, n_estimators=____, random_state=1)
Kodu Düzenle ve Çalıştır