powered by
Create a confusion matrix for any multiclass set of predicted vs observed labels in a classification problem.
confusion.matrix(actual, predicted)
data.frame. Predicted labels (rows) x Observed labels (cols).
dataframe. Original labels.
dataframe. Predicted labels.
x = c("FALSE", "TRUE", "FALSE", "TRUE", "TRUE") y = c("TRUE", "TRUE", "TRUE", "TRUE", "TRUE") confusion.matrix(x, y)
Run the code above in your browser using DataLab