powered by
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.
predicted
observed
classification_error(actual, predicted, w = NULL, ...)
A numeric vector of length one.
Observed values.
Predicted values.
Optional case weights.
Further arguments passed to accuracy.
accuracy
accuracy.
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