get_error function

Evaluate error metric between data and model prediction