mauc {ModelMetrics}R Documentation

Multiclass Area Under the Curve

Description

Calculates the area under the curve for a binary classifcation model

Usage

mauc(actual, predicted)

Arguments

actual

A vector of the labels. Can be numeric, character, or factor

predicted

A data.frame of predicted values. Can be matrix, data.frame

Examples

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)


[Package ModelMetrics version 1.2.2.2 Index]