Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mbrier

Multiclass Brier Score


Description

Brier score for multi-class classification problems with r labels defined as

I_ij is 1 if observation i has true label j, and 0 otherwise.

Note that there also is the more common definition of the Brier score for binary classification problems in bbrier().

Usage

mbrier(truth, prob, ...)

Arguments

truth

(factor())
True (observed) labels. Must have the same levels and length as response.

prob

(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.

...

(any)
Additional arguments. Currently ignored.

Value

Performance value as numeric(1).

Meta Information

  • Type: "classif"

  • Range: [0, 2]

  • Minimize: TRUE

  • Required prediction: prob

References

Brier GW (1950). “Verification of forecasts expressed in terms of probability.” Monthly Weather Review, 78(1), 1–3. doi: 10.1175/1520-0493(1950)078<0001:vofeit>2.0.co;2.

See Also

Other Classification Measures: acc(), bacc(), ce(), logloss(), mauc_aunu()

Examples

set.seed(1)
lvls = c("a", "b", "c")
truth = factor(sample(lvls, 10, replace = TRUE), levels = lvls)
prob = matrix(runif(3 * 10), ncol = 3)
colnames(prob) = levels(truth)
mbrier(truth, prob)

mlr3measures

Performance Measures for 'mlr3'

v0.3.1
LGPL-3
Authors
Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), Martin Binder [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.