Classification measure defined as $$-\frac{1}{n} \sum_{i=1}^n \log \left( p_i \right )$$ where $$p_i$$ is the probability for the true class of observation $$i$$.

logloss(truth, prob, eps = 1e-15, ...)

## Arguments

truth :: factor() True (observed) labels. Must have the same levels and length as response. :: matrix() Matrix of predicted probabilities, each column is a vector of probabilities for a specific class label. Columns must be named with levels of truth. :: numeric(1) Probabilities are clipped to max(eps, min(1 - eps, p)). Otherwise the measure would be undefined for probabilities p = 0 and p = 1. :: any Additional arguments. Currently ignored.

## Value

Performance value as numeric(1).

## Meta Information

• Type: "classif"

• Range: $$[0, \infty)$$

• Minimize: TRUE

• Required prediction: prob

Other Classification Measures: acc(), bacc(), ce(), mauc_aunu(), mbrier()
set.seed(1)
logloss(truth, prob)#> [1] 1.33052