getROC: Obtain the receiver operating characteristic (ROC) curve

View source: R/getROC.R

getROCR Documentation

Obtain the receiver operating characteristic (ROC) curve

Description

The 'getROC' function calculates the ROC curve given the test and truth values for binary classes. The true class must be binary. The test metric should be numeric.

Usage

getROC(truth, test.metric, step.size = 0.05)

Arguments

truth

The true class (0 or 1) of each observation, a binary vector.

test.metric

The test metric, a numeric vector.

step.size

The step size for the ROC curve.

Value

Coordinates on the ROC curve, that is, the false positive rate (fpr) and the true positive rate (tpr) values at each step.

Examples

## NOT RUN
# res <- getROC(truth = rep(0:1, each = 5), test.metric = c(1:10))
# ## useful function for calculating the area under the ROC curve:
# DescTools::AUC(res$tpr, res$fpr)


Mengbo-Li/brainClass documentation built on March 16, 2023, 12:06 p.m.