MAPE 平均绝对百分误差

 

from fbprophet.diagnostics import performance_metrics
df_p = performance_metrics(df_cv)
df_p.head()

 

 horizonmsermsemaemapecoverage
3297 37 days 0.481970 0.694241 0.502930 0.058371 0.673367
35 37 days 0.480991 0.693535 0.502007 0.058262 0.675879
2207 37 days 0.480936 0.693496 0.501928 0.058257 0.675879
2934 37 days 0.481455 0.693870 0.502999 0.058393 0.675879
393 37 days 0.483990 0.695694 0.503418 0.058494 0.675879

 

mape平均绝对百分误差

    • 定义
  • def evalmape(preds, dtrain):
        gaps = dtrain.get_label()
        err = abs(gaps-preds)/gaps
        err[(gaps==0)] = 0
        err = np.mean(err)*100
        return 'error',err  
posted @ 2018-09-03 16:49  bonelee  阅读(27723)  评论(0编辑  收藏  举报