我跑XGBoost XGBRegressor Python和数据集,看起来像这样:XGboost - 提高培训错误 “前”
click_id | manufacturer | category | delivery_time | price | revenue
1 |10 | 100 | 24 | 100 | 0
2 |10 | 100 | 24 | 100 | 0
3 |10 | 100 | 24 | 100 | 0
4 |10 | 100 | 24 | 100 | 120
5 |20 | 200 | 48 | 200 | 0
收入是依赖变异能够和其余的变量是功能。
当我运行XGBRegressor并设置eval_metric为“美”(平均绝对误差)的培训和验证错误不断增加。训练错误如何增加?是否有任何可能导致xgboost训练错误增加的情况(模型参数或奇怪数据点的任意组合)?
这是代码:
model = XGBRegressor(
learning_rate=0.1,
n_estimators=200,
max_depth=5,
min_child_weight=1,
gamma=0,
subsample=0.9,
colsample_bytree=0.9,
reg_alpha=10,
nthread=4)
model.fit(X_train, y_train,
eval_set=[(X_train, y_train), (X_test, y_test)], eval_metric='mae')
当eval_metric设定为预期 “RMSE” 训练误差在下降。