rank_score | R Documentation |
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).
rank_score(prob, observed)
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 |
A data.frame
with columns prank
(the normalized rank score) and observed
(the input labels).
Other classifier evaluation:
topk()
probs <- matrix(c(0.1, 0.9, 0.8, 0.2), 2, 2, byrow=TRUE,
dimnames = list(NULL, c("A", "B")))
obs <- factor(c("B", "A"))
rank_score(probs, obs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.