Python 在XGBoost中将MAPE用作评估指标
我试图在XGBoost的代码中使用MAPE,但我遇到了以下错误:“Python 在XGBoost中将MAPE用作评估指标,python,metrics,xgboost,Python,Metrics,Xgboost,我试图在XGBoost的代码中使用MAPE,但我遇到了以下错误:“/Users/runner/minifeg3/conda bld/XGBoost_1593723618214/work/src/metric/metric.cc:49:未知度量函数MAPE”。我读到最近的XGBoost升级没有这个指标,但是在文档中提到了MAPE,我需要使用它。有人知道我应该如何实施吗?下面是我正在使用的代码 先谢谢你 params = { # Parameters that we are going to tun
/Users/runner/minifeg3/conda bld/XGBoost_1593723618214/work/src/metric/metric.cc:49:未知度量函数MAPE
”。我读到最近的XGBoost升级没有这个指标,但是在文档中提到了MAPE,我需要使用它。有人知道我应该如何实施吗?下面是我正在使用的代码
先谢谢你
params = {
# Parameters that we are going to tune.
'max_depth':6,
'min_child_weight': 1,
'eta':.3,
'subsample': 1,
'colsample_bytree': 1,
# Other parameters
'objective':'reg:squarederror', }
}
params['eval_metric'] = "mape"
num_boost_round = 999
model = xgb.train(
params,
D_train,
num_boost_round=num_boost_round,
evals=[(D_test, "Test")],
early_stopping_rounds=10
)
您的答案有一些格式问题。努力改进这一点。路径和代码片段使用
`
括号。不要使用称呼语: