sklearn.metrics.max_error

sklearn.metrics.max_error(y_true, y_pred) [source]

max_error metric calculates the maximum residual error.

Read more in the User Guide.

Parameters
y_truearray-like of shape (n_samples,)

Ground truth (correct) target values.

y_predarray-like of shape (n_samples,)

Estimated target values.

Returns
max_errorfloat

A positive floating point value (the best value is 0.0).

Examples

>>> from sklearn.metrics import max_error
>>> y_true = [3, 2, 7, 1]
>>> y_pred = [4, 2, 7, 1]
>>> max_error(y_true, y_pred)
1

© 2007–2020 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/0.24/modules/generated/sklearn.metrics.max_error.html