Skip to content

Commit 54915bb

Browse files
authored
DOC Fix det_curve docstring (scikit-learn#34390)
1 parent f801a5e commit 54915bb

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

sklearn/metrics/_ranking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ class or non-thresholded decision values (as returned by
367367
368368
fnr : ndarray of shape (n_thresholds,)
369369
False negative rate (FNR) such that element i is the false negative
370-
rate of predictions with score >= thresholds[i]. This is occasionally
370+
rate of predictions with score < thresholds[i]. This is occasionally
371371
referred to as false rejection or miss rate.
372372
373373
thresholds : ndarray of shape (n_thresholds,)
374-
Decreasing thresholds on the decision function (either `predict_proba`
374+
Increasing thresholds on the decision function (either `predict_proba`
375375
or `decision_function`) used to compute FPR and FNR.
376376
377377
.. versionchanged:: 1.7

sklearn/metrics/tests/test_ranking.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,10 +1383,11 @@ def test_score_scale_invariance():
13831383
)
13841384
def test_det_curve_toydata(y_true, y_score, expected_fpr, expected_fnr):
13851385
# Check on a batch of small examples.
1386-
fpr, fnr, _ = det_curve(y_true, y_score)
1386+
fpr, fnr, thresholds = det_curve(y_true, y_score)
13871387

13881388
assert_allclose(fpr, expected_fpr)
13891389
assert_allclose(fnr, expected_fnr)
1390+
assert np.all(np.diff(thresholds) >= 0)
13901391

13911392

13921393
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)