auPRC: auPRC

View source: R/detection.R

auPRCR Documentation

auPRC

Description

Area under the Precision-Recall Curve (AUPRC) Wrapper for PRROC library

Usage

auPRC(scores_all, varnames_all, varnames_fnl)

Arguments

scores_all

numeric vector, scores of all features, order is matched with varnames character vector of functional/true attribute names.

varnames_all

character vector, all feature names with order matched with scores_all

varnames_fnl

character vector of functional variable names

Value

list of two elements: area under the PR curve (numeric) and dataframe of recall and precision values for threshold scan.

Examples

npdr.prc <- auPRC(npdr_results$beta.Z.att, npdr_results$att, 
                                           dataset$signal.names)
npdr.prc$auc
ggplot() +
 geom_line(data = npdr.prc$curve.df, aes(x = Recall, 
                                         y = Precision, color = "r")) 
curve: first column x-axis is recall = TP / (TP + FN)
       second column y-axis is precision = TP / (TP + FP)
       third column, not returned, is threshold
     : left to right, the threshold is increasing. So you start with
       all features selected/positive, and then all fnl variables are 
       positive (TP=1) and recall = 1/(1+0) (0 are declared false). 
xaxis: recall, fraction of true positives at a given threshold out of only
       the actual positives/functional
yaxis prec is fraction of positives that are acutally functional out of the  
      number threshold chose to be positive.
      Tends to decrease as all TPs are found and more FPs get added, and the
      final y value will eventually be num_functional/num_features.


insilico/glmSTIR documentation built on July 7, 2023, 12:29 a.m.