Measures the relative difference between predictions between two ways of computing them. The functions returns nan …
- mlprodict.onnxrt.validate.validate_difference.measure_relative_difference(skl_pred, ort_pred, batch=True, abs_diff=False)#
Measures the relative difference between predictions between two ways of computing them. The functions returns nan if shapes are different.
relative max difference or nan if it does not make any sense
Because approximations get bigger when the vector is high, the function computes an adjusted relative differences. Let’s assume X and Y are two vectors, let’s denote the median of X. The function returns the following metric: .
The function takes the fourth highest difference, not the three first which may happen after a conversion into float32.