performance-analytics: Assessing classifier performance

Description Methods Examples

Description

Methods to calculate the number of true positives (tp), true negatives (tn), false negatives (fn), false positive (fp), accuracy (acc), precision, recall (same as sensitivity), specificity, F1 and macroF1 scores.

Each method also accepts an naAs0 argument definiting if NAs should be replaced by 0 (default is FALSE).

Methods

Methods tp, tn, fp, fn, F1, acc and specificity:

signature(obj = "table")

Methods recall (sensitivity), precision and macroF1:

signature(obj = "classifierOutput", type = "character")
signature(obj = "classifierOutput", type = "missing")
signature(obj = "classifierOutput", type = "numeric")
signature(obj = "table")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## the confusion matrix
cm <- table(iris$Species, sample(iris$Species))
tp(cm)
tn(cm)
fp(cm)
fn(cm)
acc(cm)
precision(cm)
recall(cm)
F1(cm)
macroF1(cm)

lgatto/MLInterfaces documentation built on May 21, 2017, 12:36 p.m.