R/PerformanceMetrics.R
estimateMetrics.Rd
These functions estimate the performance metrics, either passed as arguments or
added previously with the addPerformanceMetric
function. The function
will estimate the performance metric for each method.
estimateMetricsForAssay(object, assay, evalMetric = NULL, addColData = FALSE, evalFunction = NULL, tidy = FALSE, ...) estimatePerformanceMetrics(object, addColData = FALSE, tidy = FALSE, rerun = TRUE, ...)
object | A |
---|---|
assay | A string with an assay name. Indicates the assay that should be given as input to this performance metric. |
evalMetric | A string with the name of the evaluation metric. |
addColData | Logical (default: FALSE). If TRUE, the results are added to the
|
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 ground true values. If additional parameters are specified, they must contain default values. If this parameter is passed, the metrics in the object are ignored and only this evaluation metric is estimated. |
tidy | Logical (default: FALSE). If TRUE, a long formated |
... | Additional parameters passed to the performance functions. |
rerun | Logical (default: TRUE). By default, all performance metrics are recalculated
everytime that |
Either a SummarizedBenchmark
object, a DataFrame
or
a data.frame
.
estimateMetricsForAssay
: Estimate performance metrics for a given assay
estimatePerformanceMetrics
: Estimate performance metrics for all assays
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) } ) qvalueMetrics <- estimateMetricsForAssay( sb, assay="qvalue" ) allMetrics <- estimatePerformanceMetrics( sb ) allMetricsTidy <- estimatePerformanceMetrics( sb, tidy=TRUE )