Description Usage Arguments Value Examples
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 n, where n is the total number of observations. If
there are ties, the last object in the tied group determines RKL. That is, if
all n objects are tied at the first rank but only one object is truly
relevant, RKL will have a value of n.
1 |
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. |
Numeric value of RKL.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.