Log Loss
Classification measure defined as
-mean(log(p))
where p is the probability for the true class of observation i.
logloss(truth, prob, eps = 1e-15, ...)
truth |
( |
prob |
( |
eps |
( |
... |
( |
Performance value as numeric(1)
.
Type: "classif"
Range: [0, Inf)
Minimize: TRUE
Required prediction: prob
set.seed(1) lvls = c("a", "b", "c") truth = factor(sample(lvls, 10, replace = TRUE), levels = lvls) prob = matrix(runif(3 * 10), ncol = 3, dimnames = list(NULL, lvls)) prob = t(apply(prob, 1, function(x) x / sum(x))) logloss(truth, prob)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.