mauc: Multiclass Area Under the Curve

Description Usage Arguments Examples

View source: R/ModelMetrics.R

Description

Calculates the area under the curve for a binary classifcation model

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

ModelMetrics documentation built on March 26, 2020, 7:48 p.m.