addPerformanceMetric: Add performance metric to SummarizedBenchmark object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/PerformanceMetrics.R

Description

This is a function to define performance metrics for benchmarking methods. The function is saved into the performanceMetrics slot.

Usage

1
addPerformanceMetric(object, evalMetric, assay, evalFunction = NULL)

Arguments

object

A SummarizedBenchmark object.

evalMetric

A string with the name of the evaluation metric.

assay

A string with an assay name. Indicates the assay that should be given as input to this performance metric.

evalFunction

A function that calculates a performance metric. It should contain at least two arguments, query and truth, where query is the output vector of a method and truth is the vector of true values. If additional parameters are specified, they must contain default values. If NULL, the 'evalMetric' string must be the name of a predefined metric available through 'availableMetrics()$function'.

Value

A SummarizedBenchmark object.

Author(s)

Alejandro Reyes

See Also

availableMetrics, performanceMetrics

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data( sb )
sb <- addPerformanceMetric(
   object=sb,
   assay="qvalue",
   evalMetric="TPR",
   evalFunction = function( query, truth, alpha=0.1 ){
       goodHits <- sum( (query < alpha) & truth == 1 )
       goodHits / sum(truth == 1)
   }
)

areyesq89/SummarizedBenchmark documentation built on Sept. 2, 2021, 4:15 p.m.