rocscore: Compute area under ROC curve

View source: R/cv.R

rocscoreR Documentation

Compute area under ROC curve

Description

Calculate the area under the receiver operating characteristic curve (ROC AUC).

Usage

rocscore(x, ref, n = 32L)

Arguments

x

The prediction scores.

ref

The (logical) binary response.

n

The number of points in the curve.

Value

A single number between 0 and 1 giving the ROC AUC, with an attribute called ROC which is a data frame giving the full ROC curve.

Author(s)

Kylie A. Bemis

Examples

set.seed(1)
x <- runif(100)
y <- ifelse(x > 0.5 & runif(100) > 0.2, TRUE, FALSE)
rocscore(x, y)

kuwisdelu/matter documentation built on Dec. 8, 2024, 8:09 p.m.