mIndex: M-index for multinomial outcome data

Description Usage Arguments Value References Examples

Description

M-index for multinomial data. Requires the predicted (or fitted) probability matrix p, and one of the following: labels, indices or indicator.matrix. Preferably one of the two former.

Usage

1
mIndex(p, labels, indices, indicator.matrix, pairwiseC, names = colnames(p))

Arguments

p

An n x K matrix of probabilities, where n is the number of observations, and K the number of mutually exclusive outcome categories.

labels

Vector of length n, containing the labels (character or factor) of the observed outcome categories. If specified, must correspond with the column names of p or with names.

indices

Optional. A vector of length n, containing the indices k, k = 1,...,K, of the observed outcome categories. If specified, these indices must corresond with their respective indices in p.

indicator.matrix

Optional. An n x K matrix indicating the outcome category of each observation, where n is the number of observations, and K the number of mutually exclusive outcome categories. If specified, the order of the columns should correspond with the order of the columns of p.

pairwiseC

Optional. Optained with mPairwiseC. Overrides all other parameters.

names

Optional. What are the labels to which the columns of p should be matched? By default, the colnames of the outcome matrix p.

Value

mIndex provides the M-index (= Multiclass AUC) of Hand and Till (2001), a vector of length 1.

mPairwiseC provides a matrix the pairwise c-statistics. Contains both c(i|i) and c(j|i) of equation 3 of Hand and Till (2001), and the diagonal is NA.

References

Hand DJ, Till RJ. A simple generalisation of the area under the ROC curve for multiple class classification problems. Machine learning. 2001 Nov 1;45(2):171-86.

Examples

1
2
mIndex(matrix(1/3, nrow = 3, ncol = 3), indices = 1:3)
mPairwiseC(matrix(1/3, nrow = 3, ncol = 3), indices = 1:3)

VMTdeJong/mPerformance documentation built on May 14, 2019, 7:42 a.m.