roc: roc

Description Usage Arguments Details Value Examples

View source: R/metrics.R

Description

A special case of the metricCurve function, which is widely used to diagnose classifiers. A ROC is simply a curve formed by calculating the metrics fallout and recall for classification values and actual cases, using different thresholds for the classification values.

Usage

1
roc(p, actual, res = NULL)

Arguments

p

Vector of predicted probabilities

actual

Vector of actual scores

res

Specification of the threshold resolution of the curve. Either a single number, a vector of numbers, or NULL. If a single number, it will be used as an interval to create thresholds between 0 and 1. If a vector, it will be used as the vector of thresholds. If NULL, thresholds will be based on the unique values of p.

Details

For implementation, see metricCurve.

Value

A data-frame of ROC scores.

Examples

1
2
3
predicted <- sample(seq(0,1,0.01),replace = TRUE, size = 150)
actual <- sample(c(1,0),replace = TRUE, size = 150)
metricCurve(predicted, actual, precision, recall)

Peder2911/evallib documentation built on Dec. 18, 2019, 2:41 a.m.