auPRC | R Documentation |
Area under the Precision-Recall Curve (AUPRC) Wrapper for PRROC library
auPRC(scores_all, varnames_all, varnames_fnl)
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 |
list of two elements: area under the PR curve (numeric) and dataframe of recall and precision values for threshold scan.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.