pub fn roc_curve(
scores: &[f64],
labels: &[bool],
) -> Result<RocCurveData, StatsError>Expand description
Compute an ROC curve from predicted scores and true binary labels
(true = positive class).
Higher scores are treated as “more positive”. The sweep visits each distinct
score as a threshold, emitting one point per distinct score (ties handled
together), and always begins at (0, 0).
§Errors
StatsError::LengthMismatchifscoresandlabelsdiffer in length.StatsError::EmptyInputif empty.StatsError::NoPositiveLabels/StatsError::NoNegativeLabelsif a class is absent, since TPR or FPR would be0/0.