| auc {aphylo} | R Documentation |
Area Under the Curve and Receiving Operating Curve
Description
The AUC values are computed by approximation using the area of the polygons formed under the ROC curve.
Usage
auc(pred, labels, nc = 200L, nine_na = TRUE)
## S3 method for class 'aphylo_auc'
print(x, ...)
## S3 method for class 'aphylo_auc'
plot(x, y = NULL, ...)
Arguments
pred |
A numeric vector with the predictions of the model. Values must range between 0 and 1. |
labels |
An integer vector with the labels (truth). Values should be either 0 or 1. |
nc |
Integer. Number of cutoffs to use for computing the rates and AUC. |
nine_na |
Logical. When |
x |
An object of class |
... |
Further arguments passed to the method. |
y |
Ignored. |
Value
A list:
-
tprA vector of lengthncwith the True Positive Rates. -
tnrA vector of lengthncwith the True Negative Rates. -
fprA vector of lengthncwith the False Positive Rates. -
fnrA vector of lengthncwith the False Negative Rates. -
aucA numeric value. Area Under the Curve. -
cutoffsA vector of lengthncwith the cutoffs used.
Examples
set.seed(8381)
x <- rdrop_annotations(raphylo(50), .3)
ans <- aphylo_mcmc(x ~ mu_d + mu_s + Pi)
ans_auc <- auc(predict(ans, loo = TRUE), x[,1,drop=TRUE])
print(ans_auc)
plot(ans_auc)