diff --git a/sklearn/metrics/_plot/precision_recall_curve.py b/sklearn/metrics/_plot/precision_recall_curve.py index 3e64fd776ae16..6e5549fcf27a7 100644 --- a/sklearn/metrics/_plot/precision_recall_curve.py +++ b/sklearn/metrics/_plot/precision_recall_curve.py @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/sklearn/metrics/_plot/roc_curve.py b/sklearn/metrics/_plot/roc_curve.py index a5b43ffc6cd93..3433208d7cd8c 100644 --- a/sklearn/metrics/_plot/roc_curve.py +++ b/sklearn/metrics/_plot/roc_curve.py @@ -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 @@ -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 @@ -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 @@ -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 @@ -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.