Skip to contents

Calculate a confusion matrix

Usage

confusion_matrix(observed, predicted)

# S3 method for class 'confusionmatrix'
as.data.frame(x, row.names = NULL, optional = FALSE, digits = 2, ...)

# S3 method for class 'confusionmatrix'
print(x, digits = 2, ...)

Arguments

observed

vector of observed values.

predicted

vector of predicted values.

x

the result of [confusion_matrix()].

row.names

not used.

optional

not used.

digits

number of decimal places to print.

...

currently not used.

Value

a data.frame of the confusion matrix.