Learn R Programming

gecko (version 1.0.2)

confusion.matrix: Create a confusion matrix

Description

Create a confusion matrix for any multiclass set of predicted vs observed labels in a classification problem.

Usage

confusion.matrix(actual, predicted)

Value

data.frame. Predicted labels (rows) x Observed labels (cols).

Arguments

actual

dataframe. Original labels.

predicted

dataframe. Predicted labels.

Examples

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