conf.mat {liver}R Documentation

Confusion Matrix

Description

Create a Confusion Matrix.

Usage

conf.mat( pred, actual, cutoff = NULL, reference = NULL, 
          proportion = FALSE, dnn = c( "Predict", "Actual" ), ... )

Arguments

pred

a vector of estimated values.

actual

a vector of actual values.

cutoff

cutoff value for the case that pred is vector of probabilites.

reference

a factor of classes to be used as the true results.

proportion

Logical: FALSE (default) for a confusion matrix with number of cases. TRUE, for a confusion matrix with the proportion of cases.

dnn

the names to be given to the dimensions in the result (the dimnames names).

...

options to be passed to table.

Value

the results of table on pred and actual.

Author(s)

Reza Mohammadi a.mohammadi@uva.nl and Kevin Burke kevin.burke@ul.ie

See Also

conf.mat.plot, accuracy

Examples

pred   = c( "no", "yes", "yes", "no", "no", "yes", "no", "no" )
actual = c( "yes", "no", "yes", "no", "no", "no", "yes", "yes" )

conf.mat( pred, actual )
conf.mat( pred, actual, proportion = TRUE )

[Package liver version 1.15 Index]