Measure to compare true observed labels with predicted labels in multiclass classification tasks.
Arguments
- truth
(
factor())
True (observed) labels. Must have the same levels and length asresponse.- response
(
factor())
Predicted response labels. Must have the same levels and length astruth.- sample_weights
(
numeric())
Vector of non-negative and finite sample weights. Must have the same length astruth. The vector gets automatically normalized to sum to one. Defaults to equal sample weights.- ...
(
any)
Additional arguments. Currently ignored.
Details
The Classification Accuracy is defined as $$ \sum_{i=1}^n w_i \mathbf{1} \left( t_i = r_i \right), $$ where \(w_i\) are weights normalized to sum to 1 for all observations \(x_i\).