sklearn.metrics.DetCurveDisplay
-
class sklearn.metrics.DetCurveDisplay(*, fpr, fnr, estimator_name=None, pos_label=None)
[source] -
DET curve visualization.
It is recommend to use
plot_det_curve
to create a visualizer. All parameters are stored as attributes.Read more in the User Guide.
New in version 0.24.
- Parameters
-
-
fprndarray
-
False positive rate.
-
tprndarray
-
True positive rate.
-
estimator_namestr, default=None
-
Name of estimator. If None, the estimator name is not shown.
-
pos_labelstr or int, default=None
-
The label of the positive class.
-
- Attributes
-
-
line_matplotlib Artist
-
DET Curve.
-
ax_matplotlib Axes
-
Axes with DET Curve.
-
figure_matplotlib Figure
-
Figure containing the curve.
-
See also
-
det_curve
-
Compute error rates for different probability thresholds.
-
plot_det_curve
-
Plot detection error tradeoff (DET) curve.
Examples
>>> import matplotlib.pyplot as plt >>> import numpy as np >>> from sklearn import metrics >>> y = np.array([0, 0, 1, 1]) >>> pred = np.array([0.1, 0.4, 0.35, 0.8]) >>> fpr, fnr, thresholds = metrics.det_curve(y, pred) >>> display = metrics.DetCurveDisplay( ... fpr=fpr, fnr=fnr, estimator_name='example estimator' ... ) >>> display.plot() >>> plt.show()
Methods
plot
([ax, name])Plot visualization.
-
plot(ax=None, *, name=None, **kwargs)
[source] -
Plot visualization.
- Parameters
-
-
axmatplotlib axes, default=None
-
Axes object to plot on. If
None
, a new figure and axes is created. -
namestr, default=None
-
Name of DET curve for labeling. If
None
, use the name of the estimator.
-
- Returns
-
-
displayDetCurveDisplay
-
Object that stores computed values.
-
© 2007–2020 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/0.24/modules/generated/sklearn.metrics.DetCurveDisplay.html