50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

liver (version 1.18)

conf.mat: Confusion Matrix

Description

Create a Confusion Matrix.

Usage

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

Value

the results of table on pred and 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.

Author

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

See Also

conf.mat.plot, accuracy

Examples

Run this code
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)

Run the code above in your browser using DataLab