// Compute binary ROC AUC by positive-negative score comparisons with half credit for ties. Undefined classes return minus one. pub fn positive_rank_auc(labels: vector, scores: vector) -> f64 { if len(labels)!=len(scores) { return -1.0; } let mut pairs = 0.0; let mut wins = 0.0; let mut i = 0; while iat(scores,j) { wins += 1.0; } if at(scores,i)==at(scores,j) { wins += 0.5; } } j += 1; } } i += 1; } if pairs == 0.0 { return -1.0; } wins/pairs }