accuracy: Accuracy

Description Usage Arguments Value Note Author(s) References Examples

Description

Classification accuracy measures for pcc, kappa, users accuracy, producers accuracy

Usage

1
accuracy(x, y)

Arguments

x

vector of predicted data or table/matrix contingency table

y

vector of observed data, if x is not table/matrix contingency table

Value

A list class object with the following components:

Note

Using the table function matrix positions for a 2x2 confusion matrix are TP(1), FN(3), FP(2), TN(4)

Author(s)

Jeffrey S. Evans <jeffrey_evans<at>tnc.org>

References

Cohen, J. (1960) A coefficient of agreement for nominal scales. Educational and Psychological Measurement 20 (1):37-46 Cohen, J. (1968) Weighted kappa: Nominal scale agreement with provision for scaled disagreement or partial credit. Psychological Bulletin 70 (4):213-220 Powers, D.M.W., (2011). Evaluation: From Precision, Recall and F-Measure to ROC, Informedness, Markedness & Correlation. Journal of Machine Learning Technologies 2(1):37-63.

Examples

1
2
3
4
5
6
7
8
9
 # Two classes (vector)
 observed <- sample(c(rep("Pres",50),rep("Abs",50)), 100, replace=TRUE )
 accuracy(observed[sample(1:length(observed))], observed)

 # Two classes (contingency table)
accuracy(cbind(c(15,11), c(2,123)))

 # Multiple classes
 accuracy(iris[sample(1:150),]$Species, iris$Species)

rfUtilities documentation built on Oct. 3, 2019, 9:04 a.m.