% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/classif_mbrier.R
\name{mbrier}
\alias{mbrier}
\title{Multiclass Brier Score}
\usage{
mbrier(truth, prob, sample_weights = NULL, ...)
}
\arguments{
\item{truth}{(\code{factor()})\cr
True (observed) labels.
Must have the same levels and length as \code{response}.}

\item{prob}{(\code{matrix()})\cr
Matrix of predicted probabilities, each column is a vector of probabilities for a
specific class label.
Columns must be named with levels of \code{truth}.}

\item{sample_weights}{(\code{numeric()})\cr
Vector of non-negative and finite sample weights.
Must have the same length as \code{truth}.
The vector gets automatically normalized to sum to one.
Defaults to equal sample weights.}

\item{...}{(\code{any})\cr
Additional arguments. Currently ignored.}
}
\value{
Performance value as \code{numeric(1)}.
}
\description{
Measure to compare true observed labels with predicted
probabilities
in multiclass classification tasks.
}
\details{
Brier score for multi-class classification problems with \eqn{k} labels defined as \deqn{
   \frac{1}{n} \sum_{i=1}^n \sum_{j=1}^k (I_{ij} - p_{ij})^2.
}{
}
\eqn{I_{ij}}{I_ij} is 1 if observation \eqn{x_i} has true label \eqn{j}, and 0 otherwise.
\eqn{p_{ij}}{p_ij} is the probability that observation \eqn{x_i} belongs to class \eqn{j}.

Note that there also is the more common definition of the Brier score for binary
classification problems in \code{\link[=bbrier]{bbrier()}}.
}
\section{Meta Information}{

\itemize{
\item Type: \code{"classif"}
\item Range: \eqn{[0, 2]}{[0, 2]}
\item Minimize: \code{TRUE}
\item Required prediction: \code{prob}
}
}

\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)
}
\references{
Brier GW (1950).
\dQuote{Verification of forecasts expressed in terms of probability.}
\emph{Monthly Weather Review}, \bold{78}(1), 1--3.
\doi{10.1175/1520-0493(1950)078<0001:vofeit>2.0.co;2}.
}
\seealso{
Other Classification Measures: 
\code{\link{acc}()},
\code{\link{bacc}()},
\code{\link{ce}()},
\code{\link{logloss}()},
\code{\link{mauc_aunu}()},
\code{\link{mcc}()},
\code{\link{zero_one}()}
}
\concept{Classification Measures}
\concept{classification_measure}
