rkt_prep {ROCket}R Documentation

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 class 'rkt_prep'
print(x, ...)

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

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.

Value

An environment of class rkt_prep.

Examples

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)))

[Package ROCket version 1.0.1 Index]