conf.mat: Confusion Matrix

Description Usage Arguments Value Author(s) See Also Examples

View source: R/conf.mat.R

Description

Create a Confusion Matrix.

Usage

1
2
conf.mat( pred, actual, cutoff = NULL, reference = NULL, 
          proportion = FALSE, dnn = c( "Prediction", "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

1
2
3
4
5
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 )

liver documentation built on Oct. 27, 2021, 5:06 p.m.