我正在学习XGBoost,而mae和rmse麻木是如此之大,这怎么可能?
这是我在python中使用的代码
# Create the DMatrix: housing_dmatrix
housing_dmatrix = xgb.DMatrix(data=X, label=y)
# Create the parameter dictionary: params
params = {"objective":"reg:linear", "max_depth":4}
# Perform cross-validation: cv_results
cv_results = xgb.cv(dtrain=housing_dmatrix, params=params, nfold=4, num_boost_round=5, metrics="rmse", as_pandas=True, seed=123)
# Print cv_results
print(cv_results)
# Extract and print final boosting round metric
print((cv_results["test-rmse-mean"]).tail(1))
train-rmse-mean train-rmse-std test-rmse-mean test-rmse-std
0 141767.535156 429.452682 142980.429688 1193.794436
1 102832.542969 322.473304 104891.392578 1223.157623
2 75872.617187 266.469946 79478.935547 1601.344218
3 57245.651367 273.625016 62411.921875 2220.149857
4 44401.297851 316.422372 51348.281250 2963.378741
51348.28125
发布于 2021-10-26 12:39:56
我认为您的问题是如何解释度量标准。首先,我将解释它是用来做什么的:
这意味着这两个指标都取决于预测值的大小。如果你预测一辆车的座位数量在2到7之间,你的RMSE真的很大。另一方面,如果你预测某件事在100万到1亿之间,那么RMSE就真的很低。这就是为什么您应该使用其他一些度量的主要原因,比如MAPE (平均绝对百分比错误),它将给您在0到1之间的值。
查看这链接,了解有关MAPE的更多信息,以及如何使用它-学习。
https://stackoverflow.com/questions/69716761
复制相似问题