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

Define the GB regressor

You'll now revisit the Bike Sharing Demand dataset that was introduced in the previous chapter. Recall that your task is to predict the bike rental demand using historical weather data from the Capital Bikeshare program in Washington, D.C.. For this purpose, you'll be using a gradient boosting regressor.

As a first step, you'll start by instantiating a gradient boosting regressor which you will train in the next exercise.

Bu egzersiz

Machine Learning with Tree-Based Models in Python

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

Egzersiz talimatları

  • Import GradientBoostingRegressor from sklearn.ensemble.

  • Instantiate a gradient boosting regressor by setting the parameters:

    • max_depth to 4

    • n_estimators to 200

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import GradientBoostingRegressor
____

# Instantiate gb
gb = ____(____=____, 
            ____=____,
            random_state=2)
Kodu Düzenle ve Çalıştır