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
- precisionndarray
Precision values.
- recallndarray
Recall values.
- average_precisionfloat
Average precision.
- estimator_namestr
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
(self[, ax, name])Plot visualization.
-
__init__
(self, precision, recall, average_precision, estimator_name)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
plot
(self, ax=None, name=None, **kwargs)[source]¶ Plot visualization.
Extra keyword arguments will be passed to matplotlib’s
plot
.- Parameters
- axMatplotlib Axes, default=None
Axes object to plot on. If
None
, a new figure and axes is created.- namestr, default=None
Name of precision recall curve for labeling. If
None
, use the name of the estimator.- **kwargsdict
Keyword arguments to be passed to matplotlib’s
plot
.
- Returns
- display
PrecisionRecallDisplay
Object that stores computed values.
- display