auc: Compute the area under the ROC curve

View source: R/auc.R

aucR Documentation

Compute the area under the ROC curve

Description

This function computes the numeric value of area under the ROC curve (AUC) specifically for graph structure learning.

Usage

 
auc( pred, actual, cut = 200, calibrate = TRUE )

Arguments

pred

adjacency matrix corresponding to an estimated graph. It can be an object with S3 class "bdgraph" from function bdgraph. It can be an object of S3 class "ssgraph", from the function ssgraph::ssgraph() of R package ssgraph::ssgraph(). It can be a numeric or ordered vector of the same length than actual, containing the predicted value of each observation.

actual

adjacency matrix corresponding to the actual graph structure in which a_{ij}=1 if there is a link between notes i and j, otherwise a_{ij}=0. It can be an object with S3 class "sim" from function bdgraph.sim. It can be an object with S3 class "graph" from function graph.sim. It can be a factor, numeric or character vector of responses (true class), typically encoded with 0 (controls) and 1 (cases). Only two classes can be used in a ROC curve.

cut

number of cut points.

calibrate

If TRUE, compute the value of AUC by taking the level of the probabilities into account.

Value

The numeric AUC value

Author(s)

Reza Mohammadi a.mohammadi@uva.nl; Lucas Vogels l.f.o.vogels@uva.nl

References

Tom Fawcett (2006) “An introduction to ROC analysis”. Pattern Recognition Letters 27, 861–874, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.patrec.2005.10.010")}

Xavier Robin, Natacha Turck, Alexandre Hainard, et al. (2011) “pROC: an open-source package for R and S+ to analyze and compare ROC curves”. BMC Bioinformatics, 7, 77, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/1471-2105-12-77")}.

See Also

plotroc, pROC::plot.roc(), pROC::auc(), pROC::print.roc(), bdgraph, bdgraph.mpl, compare

Examples

## Not run: 
set.seed( 5 )

# Generating multivariate normal data from a 'scale-free' graph
data.sim = bdgraph.sim( n = 200, p = 15, graph = "scale-free", vis = TRUE )

# Running BDMCMC algorithm 
sample.bdmcmc = bdgraph( data = data.sim, algorithm = "bdmcmc", iter = 10000 )

BDgraph::auc( pred = sample.bdmcmc, actual = data.sim, calibrate = TRUE )


## End(Not run)

BDgraph documentation built on Sept. 11, 2024, 5:30 p.m.