使用 SGB 进行回归
与上一课的练习一样,您将继续使用 Bike Sharing Demand 数据集。在接下来的练习中,您将使用随机梯度提升来解决这个自行车数量的回归问题。
本练习是课程的一部分
Python 树模型机器学习
练习说明
实例化一个随机梯度提升回归器(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)