sklearn.metrics.PrecisionRecallDisplay

class sklearn.metrics.PrecisionRecallDisplay(precision, recall, average_precision, estimator_name)[source]

Precision Recall visualization.

It is recommend to use plot_precision_recall_curve to create a visualizer. All parameters are stored as attributes.

Read more in the User Guide.

Parameters

precision : ndarray

Precision values.

recall : ndarray

Recall values.

average_precision : float

Average precision.

estimator_name : str

Name of estimator.

Attributes

line_

(matplotlib Artist) Precision recall curve.

ax_

(matplotlib Axes) Axes with precision recall curve.

figure_

(matplotlib Figure) Figure containing the curve.

Methods

plot([ax, name])

Plot visualization.

__init__(precision, recall, average_precision, estimator_name)[source]

Initialize self. See help(type(self)) for accurate signature.

plot(ax=None, name=None, **kwargs)[source]

Plot visualization.

Extra keyword arguments will be passed to matplotlib’s plot.

Parameters

ax : Matplotlib Axes, default=None

Axes object to plot on. If None, a new figure and axes is created.

name : str, default=None

Name of precision recall curve for labeling. If None, use the name of the estimator.

**kwargs : dict

Keyword arguments to be passed to matplotlib’s plot.

Returns

display : PrecisionRecallDisplay

Object that stores computed values.