Skip to content

Commit fa0ce3d

Browse files
authored
DOC Fix RocCurveDisplay docstring and parameter order (scikit-learn#31578)
1 parent ffe9be7 commit fa0ce3d

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

sklearn/metrics/_plot/roc_curve.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,14 @@ class RocCurveDisplay(_BinaryClassifierCurveDisplayMixin):
5959
Now accepts a list for plotting multiple curves.
6060
6161
name : str or list of str, default=None
62-
Name for labeling legend entries. The number of legend entries
63-
is determined by the `curve_kwargs` passed to `plot`.
62+
Name for labeling legend entries. The number of legend entries is determined
63+
by the `curve_kwargs` passed to `plot`, and is not affected by `name`.
6464
To label each curve, provide a list of strings. To avoid labeling
6565
individual curves that have the same appearance, this cannot be used in
6666
conjunction with `curve_kwargs` being a dictionary or None. If a
6767
string is provided, it will be used to either label the single legend entry
6868
or if there are multiple legend entries, label each individual curve with
69-
the same name. If `None`, set to `name` provided at `RocCurveDisplay`
70-
initialization. If still `None`, no name is shown in the legend.
69+
the same name. If still `None`, no name is shown in the legend.
7170
7271
.. versionadded:: 1.7
7372
@@ -185,7 +184,7 @@ def plot(
185184
186185
name : str or list of str, default=None
187186
Name for labeling legend entries. The number of legend entries
188-
is determined by `curve_kwargs`.
187+
is determined by `curve_kwargs`, and is not affected by `name`.
189188
To label each curve, provide a list of strings. To avoid labeling
190189
individual curves that have the same appearance, this cannot be used in
191190
conjunction with `curve_kwargs` being a dictionary or None. If a
@@ -441,9 +440,9 @@ def from_estimator(
441440
y_score=y_score,
442441
sample_weight=sample_weight,
443442
drop_intermediate=drop_intermediate,
443+
pos_label=pos_label,
444444
name=name,
445445
ax=ax,
446-
pos_label=pos_label,
447446
curve_kwargs=curve_kwargs,
448447
plot_chance_level=plot_chance_level,
449448
chance_level_kw=chance_level_kw,
@@ -687,7 +686,7 @@ def from_cv_results(
687686
688687
name : str or list of str, default=None
689688
Name for labeling legend entries. The number of legend entries
690-
is determined by `curve_kwargs`.
689+
is determined by `curve_kwargs`, and is not affected by `name`.
691690
To label each curve, provide a list of strings. To avoid labeling
692691
individual curves that have the same appearance, this cannot be used in
693692
conjunction with `curve_kwargs` being a dictionary or None. If a
@@ -783,8 +782,8 @@ def from_cv_results(
783782
viz = cls(
784783
fpr=fpr_folds,
785784
tpr=tpr_folds,
786-
name=name,
787785
roc_auc=auc_folds,
786+
name=name,
788787
pos_label=pos_label_,
789788
)
790789
return viz.plot(

0 commit comments

Comments
 (0)