RKL {EPX}R Documentation

Calculate rank last

Description

The peformance measure rank last (RKL) is calculated as follows: after ranking the observations in decreasing order via phat, RKL is the rank of the last truly relevant observation. Hence, RKL can take on integer values from 1 to nn, where nn is the total number of observations. If there are ties, the last object in the tied group determines RKL. That is, if all nn objects are tied at the first rank but only one object is truly relevant, RKL will have a value of nn.

Usage

RKL(y, phat, ...)

Arguments

y

True (binary) response vector where 1 is the rare/relevant class.

phat

Numeric vector of estimated probabilities of relevance.

...

Further arguments passed to or from other methods.

Value

Numeric value of RKL.

Examples

## without ties in phat

resp <- c(rep(1, 50), rep(0, 50))
prob <- (1:100)*0.01
RKL(y = resp, phat = prob) # expect 100

resp <- c(rep(0, 50), rep(1, 50))
RKL(y = resp, phat = prob) # expect 50

## with ties in phat
resp <- sample(c(1, 0), 100, replace = TRUE)
prob <- rep(1, 100)
RKL(y = resp, phat = prob) # expect 100


[Package EPX version 1.0.4 Index]