Computes the rank score (normalized rank of the true class probability) for each observation.
Lower rank scores indicate better predictions (true class has higher probability).
Usage
rank_score(prob, observed)
Value
A data.frame with columns prank (the normalized rank score) and observed (the input labels).
Arguments
prob
Numeric matrix of predicted probabilities (observations x classes).
Column names must correspond to class labels.
observed
Factor or vector of observed class labels. Must be present in colnames(prob).