confusionMatrix: Confusion Matrix

Description Usage Arguments Examples

View source: R/ModelMetrics.R

Description

Create a confusion matrix given a specific cutoff.

Usage

1
confusionMatrix(actual, predicted, cutoff = 0.5, use_names = FALSE)

Arguments

actual

A vector of the labels

predicted

A vector of predicted values

cutoff

A cutoff for the predicted values

use_names

If TRUE, the dimnames of the output matrix will be labelled to indicate which axes show the actual and predicted classes.

Examples

1
2
3
4
5
6
actual <- c(0, 0, 1)
predicted <- c(1, 0, 1)

confusionMatrix(actual, predicted)

confusionMatrix(actual, predicted, use_names = TRUE)

JackStat/ModelMetrics documentation built on July 6, 2021, 9:48 a.m.