Skip to content

Commit 91885d4

Browse files
MAINT Parameters validation for metrics.max_error (#25679)
1 parent 610a0ce commit 91885d4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

sklearn/metrics/_regression.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,12 @@ def r2_score(
976976
)
977977

978978

979+
@validate_params(
980+
{
981+
"y_true": ["array-like"],
982+
"y_pred": ["array-like"],
983+
}
984+
)
979985
def max_error(y_true, y_pred):
980986
"""
981987
The max_error metric calculates the maximum residual error.

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def _check_function_param_validation(
123123
"sklearn.metrics.f1_score",
124124
"sklearn.metrics.hamming_loss",
125125
"sklearn.metrics.log_loss",
126+
"sklearn.metrics.max_error",
126127
"sklearn.metrics.mean_absolute_error",
127128
"sklearn.metrics.mean_squared_error",
128129
"sklearn.metrics.mean_tweedie_deviance",

0 commit comments

Comments
 (0)