Skip to content

MAINT Added Parameter Validation for metrics.mean_gamma_deviance() #25853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sklearn/metrics/_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,13 @@ def mean_poisson_deviance(y_true, y_pred, *, sample_weight=None):
return mean_tweedie_deviance(y_true, y_pred, sample_weight=sample_weight, power=1)


@validate_params(
{
"y_true": ["array-like"],
"y_pred": ["array-like"],
"sample_weight": ["array-like", None],
}
)
def mean_gamma_deviance(y_true, y_pred, *, sample_weight=None):
"""Mean Gamma deviance regression loss.

Expand Down
1 change: 1 addition & 0 deletions sklearn/tests/test_public_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def _check_function_param_validation(
"sklearn.metrics.max_error",
"sklearn.metrics.mean_absolute_error",
"sklearn.metrics.mean_absolute_percentage_error",
"sklearn.metrics.mean_gamma_deviance",
"sklearn.metrics.mean_pinball_loss",
"sklearn.metrics.mean_squared_error",
"sklearn.metrics.mean_tweedie_deviance",
Expand Down