R: Compute the area under the curve of a given performance...
auc
R Documentation
Compute the area under the curve of a given performance measure.
Description
This function computes the area under the sensitivity
curve (AUSEC), the area under the specificity curve
(AUSPC), the area under the accuracy curve (AUACC), or
the area under the receiver operating characteristic
curve (AUROC).
Usage
auc(x, min = 0, max = 1)
Arguments
x
an object produced by one of the functions
sensitivity, specificity, accuracy,
or roc
min
a numeric value between 0 and 1, denoting the
cutoff that defines the start of the area under the
curve
max
a numeric value between 0 and 1, denoting the
cutoff that defines the end of the area under the curve
Value
A numeric value between zero and one denoting the area
under the curve
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(AUC)
AUC 0.3.0
Type AUCNews() to see the change log and ?AUC to get an overview.
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AUC/auc.Rd_%03d_medium.png", width=480, height=480)
> ### Name: auc
> ### Title: Compute the area under the curve of a given performance measure.
> ### Aliases: auc
>
> ### ** Examples
>
> data(churn)
>
> auc(sensitivity(churn$predictions,churn$labels))
[1] 0.8026259
>
> auc(specificity(churn$predictions,churn$labels))
[1] 0.4591936
>
> auc(accuracy(churn$predictions,churn$labels))
[1] 0.5034279
>
> auc(roc(churn$predictions,churn$labels))
[1] 0.8439201
>
>
>
>
>
> dev.off()
null device
1
>