不能在 python XGBoost 中使用平均绝对误差度量 (mae)

5 python machine-learning xgboost

我从 XGBoost 开始并愿意将它用于回归问题。

我的评估指标是平均绝对误差 (mae)。据我了解,我们可以将 XGB 与此指标一起使用(https://github.com/dmlc/xgboost/blob/master/doc/parameter.md#learning-task-parameters)。

我尝试将 XGB CV 与参数一起使用,metrics = ['mae']但出现错误,指出 mae 指标不存在:XGBoostError: unknown evaluation metric type: mae

这是我的代码:

xgdmat = xgb.DMatrix(train, y_train)

our_params = {'eta': 0.5,
              'seed': 0,
              'subsample': 1,
              'colsample_bytree': 1, 
              'max_depth': 3,
              'min_child_weight': 3,
              'objective': 'reg:linear'} 

cv_xgb = xgb.cv(params = our_params, dtrain = xgdmat, num_boost_round = 3000, nfold = 5,
                metrics = ['mae'],
                early_stopping_rounds = 100)
Run Code Online (Sandbox Code Playgroud)

有没有人已经遇到过这个问题,可以帮我解决这个问题吗?

非常感谢。