mauc {ModelMetrics} | R Documentation |
Calculates the area under the curve for a binary classifcation model
mauc(actual, predicted)
actual |
A vector of the labels. Can be |
predicted |
A data.frame of predicted values. Can be |
setosa <- glm(I(Species == 'setosa') ~ Sepal.Length, data = iris, family = 'binomial') versicolor <- glm(I(Species == 'versicolor') ~ Sepal.Length, data = iris, family = 'binomial') virginica <- glm(I(Species == 'virginica') ~ Sepal.Length, data = iris, family = 'binomial') Pred <- data.frame( setosa = predict(setosa, type = 'response') ,versicolor = predict(versicolor, type = 'response') ,virginica = predict(virginica, type = 'response') ) Predicted = Pred/rowSums(Pred) Actual = iris$Species mauc(Actual, Predicted)