Skip to main content

ROCAUC

Metric
DashAI.back.metrics.classification.ROCAUC

Area under the Receiver Operating Characteristic curve.

ROC AUC measures the classifier's ability to distinguish between classes across all possible decision thresholds. The ROC curve plots the true positive rate (recall) against the false positive rate, and the AUC summarises the entire curve in a single scalar. A value of 0.5 indicates no discriminative ability (random classifier); 1.0 is a perfect classifier.

For binary tasks, the probability of the positive class (column index 1) is used. For multiclass tasks, a one-vs-rest (OvR) averaging strategy is applied so that each class is treated as a binary problem in turn.

Unlike accuracy-based metrics, ROC AUC uses the raw probability outputs from the model rather than hard class predictions, making it sensitive to model calibration.

Range: [0, 1], higher is better (MAXIMIZE = True).

References

Methods

score(true_labels: 'DashAIDataset', probs_pred_labels: 'np.ndarray', multiclass: Optional[bool] = None) -> float

Defined on ROCAUC

Calculate RoC AUC score between true labels and predicted labels.

Parameters

true_labels : DashAIDataset
A DashAI dataset with labels.
probs_pred_labels : np.ndarray
A two-dimensional matrix in which each column represents a class and the row values represent the probability that an example belongs to the class associated with the column.
multiclass : bool, optional
Whether the task is a multiclass classification. If None, it will be determined automatically from the number of unique labels.

Returns

float
RoC AUC score between true labels and predicted labels

get_metadata(cls: 'BaseMetric') -> Dict[str, Any]

Defined on BaseMetric

Get metadata values for the current metric.

Returns

Dict[str, Any]
Dictionary with the metadata

is_multiclass(true_labels: 'np.ndarray') -> bool

Defined on ClassificationMetric

Determine if the classification problem is multiclass (more than 2 classes).

Parameters

true_labels : np.ndarray
Array of true labels.

Returns

bool
True if the problem has more than 2 unique classes, False otherwise.

Compatible with