Explain about confusion matrix in R?

A confusion matrix can be used to evaluate the accuracy of the model built. It Calculates a cross-tabulation of observed and predicted classes. This can be done using the “confusionmatrix()” function from the “caTools” package.


Here, we have created a confusion matrix, which gives a tabulated list for “actual” and “predicted” values.