การถดถอยด้วย SGB
เช่นเดียวกับแบบฝึกหัดในบทเรียนที่ผ่านมา คุณจะทำงานกับชุดข้อมูล Bike Sharing Demand ในชุดแบบฝึกหัดนี้ จะได้แก้ปัญหาการถดถอยเพื่อพยากรณ์จำนวนจักรยานโดยใช้ stochastic gradient boosting
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Machine Learning with Tree-Based Models in Python
คำแนะนำการฝึกหัด
สร้าง Stochastic Gradient Boosting Regressor (SGBR) และกำหนดค่าต่อไปนี้:
max_depthเป็น 4 และn_estimatorsเป็น 200,subsampleเป็น 0.9 และmax_featuresเป็น 0.75
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Import GradientBoostingRegressor
from sklearn.ensemble import GradientBoostingRegressor
# Instantiate sgbr
sgbr = ____(max_depth=____,
subsample=____,
max_features=____,
n_estimators=____,
random_state=2)