# Forecast Prediction : Custom metric evaluation

**URL:** <https://community.drivendata.org/t/forecast-prediction-custom-metric-evaluation/2116>\
**Category:** Power Laws\
**Created:** [March 2, 2018, 7:46pm UTC](https://community.drivendata.org/t/forecast-prediction-custom-metric-evaluation/2116 "2018-03-02T19:46:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmud19](https://avatars.discourse-cdn.com/v4/letter/n/6a8cbe/32.png) [@nmud19](https://community.drivendata.org/u/nmud19)\
**Post date:** [March 2, 2018, 7:46pm UTC](https://community.drivendata.org/t/forecast-prediction-custom-metric-evaluation/2116/1 "2018-03-02T19:46:37Z")

</div>

Hi All- How are you guys using the evalution metric “NWRMSE” for models ? For example in xgboost model has anyone created a custom NWRMSE evalution function for the model to converge ? If yes would you mind giving a hint how to write that code(I am stuck on how to use Xvars in custom eval function )? -

> <https://stackoverflow.com/questions/49076125/xgboost-custom-eval-function-using-xvars>

Or is everyone simply using rmse for the models to converge ?

---

<div class="post-metadata">

**Author:** ![nmud19](https://avatars.discourse-cdn.com/v4/letter/n/6a8cbe/32.png) [@nmud19](https://community.drivendata.org/u/nmud19)\
**Post date:** [March 5, 2018, 5:51am UTC](https://community.drivendata.org/t/forecast-prediction-custom-metric-evaluation/2116/2 "2018-03-05T05:51:36Z")

</div>

Update if this helps anyone : A workaround is declaring the TrainDF as a global variable and using it in xgb’s custom eval function. The drawback is that we cannot use it for eval /oof DF so we cannot use it for early stopping rounds.
