8000 DOC n_thresholds may be < no. of unique scores · scikit-learn/scikit-learn@749f2a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 749f2a9

Browse files
committed
DOC n_thresholds may be < no. of unique scores
See #5091
1 parent 5908bcc commit 749f2a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/metrics/ranking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def _binary_clf_curve(y_true, y_score, pos_label=None, sample_weight=None):
277277
negative samples is equal to fps[-1] (thus true negatives are given by
278278
fps[-1] - fps).
279279
280-
tps : array, shape = [n_thresholds := len(np.unique(y_score))]
280+
tps : array, shape = [n_thresholds <= len(np.unique(y_score))]
281281
An increasing count of true positives, at index i being the number
282282
of positive samples assigned a score >= thresholds[i]. The total
283283
number of positive samples is equal to tps[-1] (thus false negatives
@@ -379,7 +379,7 @@ def precision_recall_curve(y_true, probas_pred, pos_label=None,
379379
Decreasing recall values such that element i is the recall of
380380
predictions with score >= thresholds[i] and the last element is 0.
381381
382-
thresholds : array, shape = [n_thresholds := len(np.unique(probas_pred))]
382+
thresholds : array, shape = [n_thresholds <= len(np.unique(probas_pred))]
383383
Increasing thresholds on the decision function used to compute
384384
precision and recall.
385385

0 commit comments

Comments
 (0)
0