Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 81f823a

Browse filesBrowse files
MAINT Parameters validation for sklearn.metrics.jaccard_score (#25680)
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
1 parent f1f51f8 commit 81f823a
Copy full SHA for 81f823a

File tree

2 files changed

+18
-0
lines changed
Filter options

2 files changed

+18
-0
lines changed

‎sklearn/metrics/_classification.py

Copy file name to clipboardExpand all lines: sklearn/metrics/_classification.py
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,23 @@ class labels [2]_.
697697
return 1 - k
698698

699699

700+
@validate_params(
701+
{
702+
"y_true": ["array-like", "sparse matrix"],
703+
"y_pred": ["array-like", "sparse matrix"],
704+
"labels": ["array-like", None],
705+
"pos_label": [Real, str, "boolean", None],
706+
"average": [
707+
StrOptions({"micro", "macro", "samples", "weighted", "binary"}),
708+
None,
709+
],
710+
"sample_weight": ["array-like", None],
711+
"zero_division": [
712+
Options(Real, {0, 1}),
713+
StrOptions({"warn"}),
714+
],
715+
}
716+
)
700717
def jaccard_score(
701718
y_true,
702719
y_pred,

‎sklearn/tests/test_public_functions.py

Copy file name to clipboardExpand all lines: sklearn/tests/test_public_functions.py
+1Lines 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.det_curve",
124124
"sklearn.metrics.f1_score",
125125
"sklearn.metrics.hamming_loss",
126+
"sklearn.metrics.jaccard_score",
126127
"sklearn.metrics.log_loss",
127128
"sklearn.metrics.max_error",
128129
"sklearn.metrics.mean_absolute_error",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.