Learn R Programming

measures (version 0.3)

multiclass.AUNP: Weighted average 1 vs. rest multiclass AUC

Description

Computes the AUC treating a c-dimensional classifier as c two-dimensional classifiers, taking into account the prior probability of each class. See Ferri et al.: https://www.math.ucdavis.edu/~saito/data/roc/ferri-class-perf-metrics.pdf.

Usage

multiclass.AUNP(probabilities, truth)

Arguments

probabilities

[numeric] matrix of predicted probabilities with columnnames of the classes

truth

vector of true values

Examples

Run this code
# NOT RUN {
n = 20
set.seed(122)
truth = as.factor(sample(c(1,2,3), n, replace = TRUE))
probabilities = matrix(runif(60), 20, 3)
probabilities = probabilities/rowSums(probabilities)
colnames(probabilities) = c(1,2,3)
multiclass.AUNP(probabilities, truth)
# }

Run the code above in your browser using DataLab