diff --git a/R/R/metrics.r b/R/R/metrics.r index 3d8ad57..67388bb 100644 --- a/R/R/metrics.r +++ b/R/R/metrics.r @@ -123,7 +123,7 @@ auc <- function(actual, predicted) r <- rank(predicted) n_pos <- sum(actual==1) n_neg <- length(actual) - n_pos - auc <- (sum(r[actual==1]) - n_pos*(n_pos+1)/2) / (n_pos*n_neg) + auc <- sum(r[actual==1])/n_pos/n_neg - (n_pos+1)/2/n_neg auc }