Create a Confusion Matrix.
conf.mat(pred, actual, cutoff = NULL, reference = NULL,
proportion = FALSE, dnn = c("Predict", "Actual"), ...)
the results of table
on pred
and actual
.
a vector of estimated values.
a vector of actual values.
cutoff value for the case that pred
is vector of probabilites.
a factor of classes to be used as the true results.
Logical: FALSE (default) for a confusion matrix with number of cases. TRUE, for a confusion matrix with the proportion of cases.
the names to be given to the dimensions in the result (the dimnames names).
options to be passed to table
.
Reza Mohammadi a.mohammadi@uva.nl and Kevin Burke kevin.burke@ul.ie
conf.mat.plot
, accuracy
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