as.frequency.matrix: Convert confusion matrices and tables to frequency matrices

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert confusion matrices and tables to frequency matrices

Usage

1
as.frequency.matrix(confusion_matrix)

Arguments

confusion_matrix

a matrix or table object that can be assumed to be a confusion matrix.

Value

a frequency matrix normalizing by the column total (expresed as percentages)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
table(1:3, 3:1)
#   1 2 3
# 1 0 0 1
# 2 0 1 0
# 3 1 0 0
as.frequency.matrix(table(1:3, 3:1))
#
#     1   2   3
# 1   0   0 100
# 2   0 100   0
# 3 100   0   0
as.frequency.matrix(table(c(3,3,2), 3:1))
#
#     2   3
# 1 100   0
# 2   0 100
# 3   0 100

jspaezp/sctree documentation built on April 30, 2020, 10:36 p.m.