MLInterfaces (version 1.50.0)

confuTab: Compute confusion tables for a confusion matrix.

Description

Given a n by n confusion matrix, the function returns a list of n 2 by 2 tables with false positives, false negatives, false positives and true negative for each initial variables.

Usage

confuTab(obj, naAs0. = FALSE)

Arguments

obj
An instance of class table. Must be square.
naAs0.
A logical, defining if NAs are to be replaced by 0s.

Value

A list of length nrow(obj) and names rownames(obj).

See Also

The tp, tn, fp, fn, methods to extract the respective classification outcomes from a contingency matrix.

Examples

Run this code
## the confusion matrix
cm <- table(iris$Species, sample(iris$Species))
## the 3 confusion tables
(ct <- confuTab(cm))

Run the code above in your browser using DataCamp Workspace