Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.metrics`.max_error

sklearn.metrics.max_error(y_true, y_pred)

  The max_error metric calculates the maximum residual error.

  Read more in the User Guide.

  Parameters:
    y_true array-like of shape (n_samples,)

      Ground truth (correct) target values.

    y_pred array-like of shape (n_samples,)

      Estimated target values.

  Returns:
    max_error float

      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