score: Score the results of BRACoD

Description Usage Arguments Value Examples

View source: R/BRACoD.R

Description

This calculate the precision, recall and F1 of your BRACoD results if you know the ground truth, ie. if this is simulated data.

Usage

1
score(bugs_identified, bugs_actual)

Arguments

bugs_identified

a list of integers corresponding to the indicies of the bugs you identified with BRACoD

bugs_actual

a list of integers corresponding to the indicies of the bugs that truely contribute to butyrate levels

Value

a list containing 1) the precision 2) the recall 3) the f1 metric

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
df_summary <- summarize_trace(trace, colnames(sim_relab))
bugs_identified <- df_summary$bugs
bugs_actual <- which(contributions != 0)

r <- score(bugs_identified, bugs_actual)

precision <- r[[1]]
recall <- r[[2]]
f1 <- r[[3]]

print(sprintf("Precision: %.2f, Recall: %.2f, F1: %.2f",precision, recall, f1))

## End(Not run)

BRACoD.R documentation built on May 17, 2021, 9:09 a.m.

Related to score in BRACoD.R...