21
21
22
22
import warnings
23
23
from functools import partial
24
- from numbers import Integral
24
+ from numbers import Real
25
25
26
26
import numpy as np
27
27
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):
723
723
y_score : ndarray of shape (n_samples,)
724
724
Estimated probabilities or output of a decision function.
725
725
726
- pos_label : int or str, default=None
726
+ pos_label : int, float, bool or str, default=None
727
727
The label of the positive class.
728
728
729
729
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
908
908
{
909
909
"y_true" : ["array-like" ],
910
910
"y_score" : ["array-like" ],
911
- "pos_label" : [Integral , str , None ],
911
+ "pos_label" : [Real , str , "boolean" , None ],
912
912
"sample_weight" : ["array-like" , None ],
913
913
"drop_intermediate" : ["boolean" ],
914
914
}
@@ -933,7 +933,7 @@ def roc_curve(
933
933
class, confidence values, or non-thresholded measure of decisions
934
934
(as returned by "decision_function" on some classifiers).
935
935
936
- pos_label : int or str, default=None
936
+ pos_label : int, float, bool or str, default=None
937
937
The label of the positive class.
938
938
When ``pos_label=None``, if `y_true` is in {-1, 1} or {0, 1},
939
939
``pos_label`` is set to 1, otherwise an error will be raised.
0 commit comments