Skip to content
Closed
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
29 changes: 17 additions & 12 deletions sklearn/metrics/_plot/precision_recall_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ class PrecisionRecallDisplay(_BinaryClassifierCurveDisplayMixin):

prevalence_pos_label : float, default=None
The prevalence of the positive label. It is used for plotting the
chance level line. If None, the chance level line will not be plotted
even if `plot_chance_level` is set to True when plotting.
prevalence baseline line. If None, the prevalence baselin line will not be
plotted even if `plot_chance_level` is set to True when plotting.


.. versionadded:: 1.3

Expand All @@ -59,7 +60,8 @@ class PrecisionRecallDisplay(_BinaryClassifierCurveDisplayMixin):
Precision recall curve.

chance_level_ : matplotlib Artist or None
The chance level line. It is `None` if the chance level is not plotted.
The prevalence baseline line. It is `None` if the prevalence baseline
is not plotted.

.. versionadded:: 1.3

Expand Down Expand Up @@ -154,15 +156,16 @@ def plot(
`estimator_name` if not `None`, otherwise no labeling is shown.

plot_chance_level : bool, default=False
Whether to plot the chance level. The chance level is the prevalence
of the positive label computed from the data passed during
Whether to plot the prevalence baseline. The prevalence baseline is the
prevalence of the positive label computed from the data passed during
:meth:`from_estimator` or :meth:`from_predictions` call.


.. versionadded:: 1.3

chance_level_kw : dict, default=None
Keyword arguments to be passed to matplotlib's `plot` for rendering
the chance level line.
the prevalence baseline line.

.. versionadded:: 1.3

Expand Down Expand Up @@ -326,15 +329,16 @@ def from_estimator(
Axes object to plot on. If `None`, a new figure and axes is created.

plot_chance_level : bool, default=False
Whether to plot the chance level. The chance level is the prevalence
of the positive label computed from the data passed during
Whether to plot the prevalence baseline. The prevalence baseline is the
prevalence of the positive label computed from the data passed during
:meth:`from_estimator` or :meth:`from_predictions` call.


.. versionadded:: 1.3

chance_level_kw : dict, default=None
Keyword arguments to be passed to matplotlib's `plot` for rendering
the chance level line.
the prevalence baseline line.

.. versionadded:: 1.3

Expand Down Expand Up @@ -466,15 +470,16 @@ def from_predictions(
Axes object to plot on. If `None`, a new figure and axes is created.

plot_chance_level : bool, default=False
Whether to plot the chance level. The chance level is the prevalence
of the positive label computed from the data passed during
Whether to plot the prevalence baseline. The prevalence baseline is the
prevalence of the positive label computed from the data passed during
:meth:`from_estimator` or :meth:`from_predictions` call.


.. versionadded:: 1.3

chance_level_kw : dict, default=None
Keyword arguments to be passed to matplotlib's `plot` for rendering
the chance level line.
the prevalence baseline line.

.. versionadded:: 1.3

Expand Down
19 changes: 10 additions & 9 deletions sklearn/metrics/_plot/roc_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class RocCurveDisplay(_BinaryClassifierCurveDisplayMixin):
are plotted.

chance_level_ : matplotlib Artist or None
The chance level line. It is `None` if the chance level is not plotted.
The prevalence baseline line.
It is `None` if the prevalence baseline is not plotted.

.. versionadded:: 1.3

Expand Down Expand Up @@ -206,13 +207,13 @@ def plot(
.. versionadded:: 1.7

plot_chance_level : bool, default=False
Whether to plot the chance level.
Whether to plot the prevalence baseline.

.. versionadded:: 1.3

chance_level_kw : dict, default=None
Keyword arguments to be passed to matplotlib's `plot` for rendering
the chance level line.
the prevalence baseline line.

.. versionadded:: 1.3

Expand Down Expand Up @@ -374,13 +375,13 @@ def from_estimator(
.. versionadded:: 1.7

plot_chance_level : bool, default=False
Whether to plot the chance level.
Whether to plot the prevalence baseline line.

.. versionadded:: 1.3

chance_level_kw : dict, default=None
Keyword arguments to be passed to matplotlib's `plot` for rendering
the chance level line.
the prevalence baseline line.

.. versionadded:: 1.3

Expand Down Expand Up @@ -516,13 +517,13 @@ def from_predictions(
.. versionadded:: 1.7

plot_chance_level : bool, default=False
Whether to plot the chance level.
Whether to plot the prevalence baseline.

.. versionadded:: 1.3

chance_level_kw : dict, default=None
Keyword arguments to be passed to matplotlib's `plot` for rendering
the chance level line.
the prevalence baseline line.

.. versionadded:: 1.3

Expand Down Expand Up @@ -685,11 +686,11 @@ def from_cv_results(
labeled with the mean ROC AUC score.

plot_chance_level : bool, default=False
Whether to plot the chance level.
Whether to plot the prevalence baseline line.

chance_level_kwargs : dict, default=None
Keyword arguments to be passed to matplotlib's `plot` for rendering
the chance level line.
the prevalence baseline line.

despine : bool, default=False
Whether to remove the top and right spines from the plot.
Expand Down
Loading