convert.confusion.matrix: Converts the position of any element of confusion matrix to...

Description Usage Arguments Value Author(s) References Examples

View source: R/convert.confusion.matrix.R

Description

This function receives a confusion matrix and the matrix values to keep the order VP, FP, FN, VN.

Usage

1
convert.confusion.matrix(confusion.matrix, cm.position)

Arguments

confusion.matrix

is the confusion matrix to be converted.

cm.position

is the position of your VP, FP, FN, VN at the confusion matrix.

Value

a new confusion matrix

Author(s)

Elias Carvalho

References

STORY, Michael; CONGALTON, Russell G. Accuracy assessment: a user’s perspective. Photogrammetric Engineering and remote sensing, v. 52, n. 3, p. 397-399, 1986.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Clean environment
closeAllConnections()
rm(list=ls())
# Set enviroment
# setwd("to your working directory")
# Load packages
library(bnpa)
# Creates a confusion matrix
confusion.matrix <-matrix(c(12395, 4, 377, 1), nrow=2, ncol=2, byrow=TRUE)
# Creates a vector with the position of VP, FP, FN, VN
cm.position <- c(4,3,2,1)
# Shows the original confusion matrix
confusion.matrix
# Converts the confusion matrix
confusion.matrix <- convert.confusion.matrix(confusion.matrix, cm.position)
# Shows the converted confusion matrix
confusion.matrix

bnpa documentation built on Aug. 2, 2019, 1:05 a.m.