我跑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」 訓練誤差在下降。