@@ -814,6 +814,14 @@ def _binary_clf_curve(y_true, y_score, pos_label=None, sample_weight=None):
814
814
return fps , tps , y_score [threshold_idxs ]
815
815
816
816
817
+ @validate_params (
818
+ {
819
+ "y_true" : ["array-like" ],
820
+ "probas_pred" : ["array-like" ],
821
+ "pos_label" : [Real , str , "boolean" , None ],
822
+ "sample_weight" : ["array-like" , None ],
823
+ }
824
+ )
817
825
def precision_recall_curve (y_true , probas_pred , * , pos_label = None , sample_weight = None ):
818
826
"""Compute precision-recall pairs for different probability thresholds.
819
827
@@ -839,11 +847,11 @@ def precision_recall_curve(y_true, probas_pred, *, pos_label=None, sample_weight
839
847
840
848
Parameters
841
849
----------
842
- y_true : ndarray of shape (n_samples,)
850
+ y_true : array-like of shape (n_samples,)
843
851
True binary labels. If labels are not either {-1, 1} or {0, 1}, then
844
852
pos_label should be explicitly given.
845
853
846
- probas_pred : ndarray of shape (n_samples,)
854
+ probas_pred : array-like of shape (n_samples,)
847
855
Target scores, can either be probability estimates of the positive
848
856
class, or non-thresholded measure of decisions (as returned by
849
857
`decision_function` on some classifiers).
0 commit comments