Skip to content
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
17 changes: 17 additions & 0 deletions sklearn/metrics/_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,23 @@ class labels [2]_.
return 1 - k


@validate_params(
{
"y_true": ["array-like", "sparse matrix"],
"y_pred": ["array-like", "sparse matrix"],
"labels": ["array-like", None],
"pos_label": [Real, str, "boolean", None],
"average": [
StrOptions({"micro", "macro", "samples", "weighted", "binary"}),
None,
],
"sample_weight": ["array-like", None],
"zero_division": [
Options(Real, {0, 1}),
StrOptions({"warn"}),
],
}
)
def jaccard_score(
y_true,
y_pred,
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 @@ -122,6 +122,7 @@ def _check_function_param_validation(
"sklearn.metrics.det_curve",
"sklearn.metrics.f1_score",
"sklearn.metrics.hamming_loss",
"sklearn.metrics.jaccard_score",
"sklearn.metrics.log_loss",
"sklearn.metrics.mean_absolute_error",
"sklearn.metrics.mean_squared_error",
Expand Down