Skip to content

DOC Add missing directives to det_curve-related docstrings #31225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sklearn/metrics/_plot/det_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def from_estimator(
from the previous or subsequent threshold. All points with the same
tp value have the same `fnr` and thus same y coordinate.

.. versionadded:: 1.7

response_method : {'predict_proba', 'decision_function', 'auto'} \
default='auto'
Specifies whether to use :term:`predict_proba` or
Expand Down Expand Up @@ -227,6 +229,8 @@ def from_predictions(
from the previous or subsequent threshold. All points with the same
tp value have the same `fnr` and thus same y coordinate.

.. versionadded:: 1.7

pos_label : int, float, bool or str, default=None
The label of the positive class. When `pos_label=None`, if `y_true`
is in {-1, 1} or {0, 1}, `pos_label` is set to 1, otherwise an
Expand Down
7 changes: 5 additions & 2 deletions sklearn/metrics/_ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,11 @@ def det_curve(

thresholds : ndarray of shape (n_thresholds,)
Decreasing thresholds on the decision function (either `predict_proba`
or `decision_function`) used to compute FPR and FNR. An arbitrary
threshold at infinity is added for the case `fpr=0` and `fnr=1`.
or `decision_function`) used to compute FPR and FNR.

.. versionchanged:: 1.7
An arbitrary threshold at infinity is added for the case `fpr=0`
and `fnr=1`.

See Also
--------
Expand Down