Skip to main content

function wandb.plot.roc_curve()

Constructs Receiver Operating Characteristic (ROC) curve chart.

Args

Sequence[numbers.Number]
The true class labels (ground truth) for the target variable. Shape should be (num_samples,).
Sequence[Sequence[float]] | None
The predicted probabilities or decision scores for each class. Shape should be (num_samples, num_classes).
list[str] | None
Human-readable labels corresponding to the class indices in y_true. For example, if labels=['dog', 'cat'], class 0 will be displayed as ‘dog’ and class 1 as ‘cat’ in the plot. If None, the raw class indices from y_true will be used. Default is None.
list[numbers.Number] | None
A subset of unique class labels to include in the ROC curve. If None, all classes in y_true will be plotted. Default is None.
str
Title of the ROC curve plot. Default is “ROC Curve”.
bool
Whether the table should be split into a separate section in the W&B UI. If True, the table will be displayed in a section named “Custom Chart Tables”. Default is False.

Returns

CustomChart: A custom chart object that can be logged to W&B. To log the chart, pass it to wandb.log().

Raises

  • wandb.Error: If numpy, pandas, or scikit-learn are not found.

Examples