coco_pipe.viz.plot_roc_curve#
- coco_pipe.viz.plot_roc_curve(result_or_curve, model=None, fold=None, title=None, ax=None, figsize=None, mean_only=False)#
Plot receiver-operating-characteristic curves.
- Parameters:
result_or_curve (Any) – Experiment result with
get_roc_curve()or a DataFrame containingModel,FPR, andTPR. OptionalFoldandClasscolumns are used for grouping.model (str | None) – Optional model name to display.
fold (int | None) – Optional fold index to display.
title (str | None) – Optional axes title. Defaults to
"ROC Curve".ax (Axes | None) – Existing Matplotlib axes to draw into.
figsize (tuple[float, float] | None) – Figure size used when creating a new axes.
mean_only (bool) – If True, interpolate fold curves onto a common x-grid and draw the mean curve with a standard-deviation band.
- Returns:
The created or reused figure and axes.
- Return type:
See also
coco_pipe.viz.interactive.decoding.plot_roc_curveInteractive Plotly version.
plot_pr_curvePrecision-recall curve.
plot_calibration_curveProbability calibration reliability curve.
plot_confusion_matrixPredicted-vs-true class heatmap.
Examples
>>> import numpy as np, pandas as pd >>> from coco_pipe.viz import decoding as viz >>> df = pd.DataFrame( ... { ... "Model": "SVM", ... "FPR": np.linspace(0, 1, 10), ... "TPR": np.linspace(0, 1, 10) ** 0.5, ... } ... ) >>> fig, ax = viz.plot_roc_curve(df)