withConfmat: withConfmat

Description Usage Arguments Value Examples

View source: R/metrics.R

Description

Helper function. Computes a statistic from predicted and actual values, using an intermediate confusion matrix.

Usage

1
withConfmat(p, a, fun)

Arguments

p

Predicted values

a

Actual values

Value

The result of whatever function is passed as fun (recall/precision/accuracy etc.)

Examples

1
2
3
4
5
6
battery <- list(precision = precision, recall = recall,
                fallout = fallout, accuracy = accuracy) 
pred <- sample(c(1,0),replace = TRUE, size = 150)
actual <- sample(c(1,0),replace = TRUE, size = 150)
lapply(battery,function(fun){
       withConfmat(pred,actual,fun)})

Peder2911/evallib documentation built on Dec. 18, 2019, 2:41 a.m.