Debian Codegraph @

man/mauc.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/ModelMetrics.R
3 \name{mauc}
4 \alias{mauc}
5 \title{Multiclass Area Under the Curve}
6 \usage{
7 mauc(actual, predicted)
8 }
9 \arguments{
10 \item{actual}{A vector of the labels. Can be \code{numeric, character, or factor}}
11
12 \item{predicted}{A data.frame of predicted values. Can be \code{matrix, data.frame}}
13 }
14 \description{
15 Calculates the area under the curve for a binary classifcation model
16 }
17 \examples{
18 setosa <- glm(I(Species == 'setosa') ~ Sepal.Length, data = iris, family = 'binomial')
19 versicolor <- glm(I(Species == 'versicolor') ~ Sepal.Length, data = iris, family = 'binomial')
20 virginica <- glm(I(Species == 'virginica') ~ Sepal.Length, data = iris, family = 'binomial')
21
22 Pred <-
23 data.frame(
24 setosa = predict(setosa, type = 'response')
25 ,versicolor = predict(versicolor, type = 'response')
26 ,virginica = predict(virginica, type = 'response')
27 )
28
29 Predicted = Pred/rowSums(Pred)
30 Actual = iris$Species
31
32 mauc(Actual, Predicted)
33
34 }