Custom metric evaluation function.
The function has 3 parts:
- map: the function is executed per row and return computation state in form of array of doubles
- reduce: combine 2 map results
- metric: compute final metric based on the computed state
double map(double preds,
Compute temporary state for given row of data.
The method is invoked per row represented by prediction and actual response
and return "temporary computation state that is
later combined together with other map-results to form final value of metric.