confuTab {MLInterfaces} | R Documentation

## 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 `NA`s are to be replaced by `0`s.

### Value

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

### Author(s)

Laurent Gatto <lg390@cam.ac.uk>

### See Also

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

### Examples

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

[Package MLInterfaces version 1.70.0 Index]