@@ -47,8 +47,9 @@ class PrecisionRecallDisplay(_BinaryClassifierCurveDisplayMixin):
47
47
.. versionadded:: 0.24
48
48
49
49
prevalence_pos_label : float, default=None
50
- The prevalence of the positive label. It is used for plotting the
51
- chance level line. If None, the chance level line will not be plotted
50
+ The prevalence of the positive label. It is used for plotting the
51
+ prevalence baseline line (horizontal line representing the proportion
52
+ of positive samples). If None, the baseline line will not be plotted
52
53
even if `plot_chance_level` is set to True when plotting.
53
54
54
55
.. versionadded:: 1.3
@@ -58,8 +59,10 @@ class PrecisionRecallDisplay(_BinaryClassifierCurveDisplayMixin):
58
59
line_ : matplotlib Artist
59
60
Precision recall curve.
60
61
61
- chance_level_ : matplotlib Artist or None
62
- The chance level line. It is `None` if the chance level is not plotted.
62
+ chance_level : matplotlib Artist or None
63
+ The prevalence baseline line (horizontal line representing the proportion
64
+ of positive samples). It is `None` if the baseline is not plotted.
65
+
63
66
64
67
.. versionadded:: 1.3
65
68
@@ -154,15 +157,18 @@ def plot(
154
157
`estimator_name` if not `None`, otherwise no labeling is shown.
155
158
156
159
plot_chance_level : bool, default=False
157
- Whether to plot the chance level . The chance level is the prevalence
158
- of the positive label computed from the data passed during
160
+ Whether to plot the prevalence baseline . The baseline is the prevalence
161
+ of the positive label computed from the data passed during
159
162
:meth:`from_estimator` or :meth:`from_predictions` call.
160
163
164
+
161
165
.. versionadded:: 1.3
162
166
163
167
chance_level_kw : dict, default=None
164
- Keyword arguments to be passed to matplotlib's `plot` for rendering
165
- the chance level line.
168
+ Keyword arguments to be passed to matplotlib's `plot` for rendering
169
+ the prevalence baseline line (horizontal line representing the
170
+ proportion of positive samples).
171
+
166
172
167
173
.. versionadded:: 1.3
168
174
@@ -224,8 +230,8 @@ def plot(
224
230
if self .prevalence_pos_label is None :
225
231
raise ValueError (
226
232
"You must provide prevalence_pos_label when constructing the "
227
- "PrecisionRecallDisplay object in order to plot the chance "
228
- "level line. Alternatively, you may use "
233
+ "PrecisionRecallDisplay object in order to plot the prevalence "
234
+ "baseline line. Alternatively, you may use "
229
235
"PrecisionRecallDisplay.from_estimator or "
230
236
"PrecisionRecallDisplay.from_predictions "
231
237
"to automatically set prevalence_pos_label"
@@ -326,15 +332,18 @@ def from_estimator(
326
332
Axes object to plot on. If `None`, a new figure and axes is created.
327
333
328
334
plot_chance_level : bool, default=False
329
- Whether to plot the chance level. The chance level is the prevalence
330
- of the positive label computed from the data passed during
331
- :meth:`from_estimator` or :meth:`from_predictions` call.
335
+ Whether to plot the prevalence baseline (horizontal reference line).
336
+ The baseline represents the prevalence of the positive label computed
337
+ from the data passed during :meth:`from_estimator` or
338
+ :meth:`from_predictions` call.
332
339
333
340
.. versionadded:: 1.3
334
341
335
342
chance_level_kw : dict, default=None
336
- Keyword arguments to be passed to matplotlib's `plot` for rendering
337
- the chance level line.
343
+ Keyword arguments to be passed to matplotlib's `plot` for rendering
344
+ the prevalence baseline line (horizontal line representing the
345
+ proportion of positive samples).
346
+
338
347
339
348
.. versionadded:: 1.3
340
349
@@ -466,15 +475,19 @@ def from_predictions(
466
475
Axes object to plot on. If `None`, a new figure and axes is created.
467
476
468
477
plot_chance_level : bool, default=False
469
- Whether to plot the chance level. The chance level is the prevalence
470
- of the positive label computed from the data passed during
471
- :meth:`from_estimator` or :meth:`from_predictions` call.
478
+ Whether to plot the prevalence baseline (horizontal reference line).
479
+ The baseline represents the prevalence of the positive label computed
480
+ from the data passed during :meth:`from_estimator` or
481
+ :meth:`from_predictions` call.
482
+
472
483
473
484
.. versionadded:: 1.3
474
485
475
486
chance_level_kw : dict, default=None
476
- Keyword arguments to be passed to matplotlib's `plot` for rendering
477
- the chance level line.
487
+ Keyword arguments to be passed to matplotlib's `plot` for rendering
488
+ the prevalence baseline line (horizontal line representing the
489
+ proportion of positive samples).
490
+
478
491
479
492
.. versionadded:: 1.3
480
493
0 commit comments