Learn R Programming

ROCket (version 1.0.3)

rkt_prep: ROC points

Description

Calculate the ROC points for all meaningful cutoff values based on predicted scores.

Usage

rkt_prep(scores, positives, negatives = totals - positives, totals = 1)

# S3 method for rkt_prep print(x, ...)

# S3 method for rkt_prep plot(x, ...)

Value

An environment of class rkt_prep.

Arguments

scores

Numeric vector containing the predicted scores.

positives

Numeric vector of the same length as scores. The number of positive entities associated with each score. If data is not aggregated, a vector of 0's and 1's.

negatives

Similar to positives. Defaults to totals - positives.

totals

How many times each score was predicted. Defaults to 1 (assuming data is not aggregated). If any value in positives is greater than 1 (aggregated data), totals must be a vector. Not needed if negatives is supplied.

x

An environment of class rkt_prep for S3 methods.

...

Further parameters.

Details

In a situation where many of the predicted scores have the same value it might be easier and faster to use aggregated data.

Examples

Run this code
require(ROCket)

plot(rkt_prep(1:4, c(0, 1, 0, 1)))
plot(rkt_prep(1:4, c(0, 1000, 0, 1000), totals = 1000))
plot(rkt_prep(1:4, c(100, 200, 300, 400), totals = c(1000, 800, 600, 400)))

Run the code above in your browser using DataLab