The max_error metric calculates the maximum residual error.
Read more in the User Guide.
Ground truth (correct) target values.
Estimated target values.
A positive floating point value (the best value is 0.0).
>>> from sklearn.metrics import max_error >>> y_true = [3, 2, 7, 1] >>> y_pred = [4, 2, 7, 1] >>> max_error(y_true, y_pred) np.int64(1)
© 2007–2025 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.6/modules/generated/sklearn.metrics.max_error.html