confusion: Confusion matrix.

Description Usage Arguments Details Examples

Description

Computes the confusion matrix of a classification result.

Usage

1
confusion(true, predicted)

Arguments

true

true classes.

predicted

predicted classes.

Details

This is a pure print function.

Examples

1
2
3
true <- c('a','a','b','b','c','c')
predicted <- c('a','c','b','b','a','c')
confusion(true, predicted)

Example output

Attaching package: 'mixlm'

The following objects are masked from 'package:stats':

    glm, lm

            True
Predicted      a b   c
  a          1.0 0 1.0
  b          0.0 2 0.0
  Total      2.0 2 2.0
  Correct    1.0 2 1.0
  Proportion 0.5 1 0.5

Proportions correct
a b c 
1 0 1 

N correct/N total = 2/2 = 1

mixlm documentation built on May 2, 2019, 6:08 p.m.

Related to confusion in mixlm...