MetricsWeighted (version 0.3.0)

classification_error: Classification Error

Description

Calculates weighted classification error, i.e. the weighted proportion of elements in predicted that are unequal to those in observed. Equals 1 - accuracy, thus lower values are better.

Usage

classification_error(actual, predicted, w = NULL, ...)

Arguments

actual

Observed values.

predicted

Predicted values.

w

Optional case weights.

...

Further arguments passed to accuracy.

Value

A numeric vector of length one.

See Also

accuracy.

Examples

Run this code
# NOT RUN {
classification_error(c(0, 0, 1, 1), c(0, 0, 1, 1))
classification_error(c(1, 0, 0, 1), c(0, 0, 1, 1))
classification_error(c(1, 0, 0, 1), c(0, 0, 1, 1), w = 1:4)
# }

Run the code above in your browser using DataLab