Skip to main content

roc_auc_score

Function roc_auc_score 

Source
pub fn roc_auc_score(y_true: &[usize], y_score: &[f32]) -> f32
Expand description

Binary ROC AUC via the Mann–Whitney U statistic (rank-based, tie-averaged).

y_true: labels in {0, 1}. y_score: predicted scores (higher ⇒ more likely positive). Returns the area under the ROC curve, matching sklearn.metrics.roc_auc_score. Returns NaN if only one class is present (AUC is undefined), mirroring sklearn raising in that case.

§Panics

Panics if y_true and y_score differ in length.