probly.plot.ood.plot_roc_curve¶
- probly.plot.ood.plot_roc_curve(fpr: np.ndarray, tpr: np.ndarray, auroc: float, fpr95: float | None = None, ax: Axes | None = None, config: PlotConfig | None = None) Figure | SubFigure[source]¶
Plot a Receiver Operating Characteristic (ROC) curve.
The curve is annotated with the AUROC score and, optionally, the false positive rate at 95 % TPR. A diagonal reference line representing a random classifier is included for visual calibration.
- Parameters:
fpr – False positive rate values as returned by
sklearn.metrics.roc_curve.tpr – True positive rate values as returned by
sklearn.metrics.roc_curve.auroc – Area under the ROC curve.
fpr95 – False positive rate at 95 % TPR. When provided it is appended to the legend label.
ax – Optional pre-existing axes for subplot composition. When
Nonea new figure is created.config – Plot configuration. Defaults to
PlotConfig()whenNone.
- Returns:
The figure that contains the ROC curve.
- Raises:
RuntimeError – If ax is provided but has no associated figure.