8000 FIX pos_label constraint in roc_curve (param validation) (#25131) · npache/scikit-learn@929b3dc · GitHub
[go: up one dir, main page]

Skip to content

Commit 929b3dc

Browse files
authored
FIX pos_label constraint in roc_curve (param validation) (scikit-learn#25131)
1 parent d949e7f commit 929b3dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sklearn/metrics/_ranking.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import warnings
2323
from functools import partial
24-
from numbers import Integral
24+
from numbers import Real
2525

2626
import numpy as np
2727
from scipy.sparse import csr_matrix, issparse
@@ -723,7 +723,7 @@ def _binary_clf_curve(y_true, y_score, pos_label=None, sample_weight=None):
723723
y_score : ndarray of shape (n_samples,)
724724
Estimated probabilities or output of a decision function.
725725
726-
pos_label : int or str, default=None
726+
pos_label : int, float, bool or str, default=None
727727
The label of the positive class.
728728
729729
sample_weight : array-like of shape (n_samples,), default=None
@@ -908,7 +908,7 @@ def precision_recall_curve(y_true, probas_pred, *, pos_label=None, sample_weight
908908
{
909909
"y_true": ["array-like"],
910910
"y_score": ["array-like"],
911-
"pos_label": [Integral, str, None],
911+
"pos_label": [Real, str, "boolean", None],
912912
"sample_weight": ["array-like", None],
913913
"drop_intermediate": ["boolean"],
914914
}
@@ -933,7 +933,7 @@ def roc_curve(
933933
class, confidence values, or non-thresholded measure of decisions
934934
(as returned by "decision_function" on some classifiers).
935935
936-
pos_label : int or str, default=None
936+
pos_label : int, float, bool or str, default=None
937937
The label of the positive class.
938938
When ``pos_label=None``, if `y_true` is in {-1, 1} or {0, 1},
939939
``pos_label`` is set to 1, otherwise an error will be raised.

0 commit comments

Comments
 (0)
0