Learn R Programming

liver (version 1.19)

accuracy: Average classification accuracy

Description

Computes average classification accuracy.

Usage

accuracy(pred, actual, cutoff = NULL, reference = NULL)

Value

the computed average classification accuracy (numeric value).

Arguments

pred

a numerical vector of estimated values.

actual

a numerical vector of actual values.

cutoff

cutoff value for the case that pred is vector of probabilites.

reference

a factor of classes to be used as the true results.

Author

Reza Mohammadi a.mohammadi@uva.nl and Kevin Burke kevin.burke@ul.ie

See Also

conf.mat, mse, mae

Examples

Run this code
pred   = c("no", "yes", "yes", "no", "no", "yes", "no", "no")
actual = c("yes", "no", "yes", "no", "no", "no", "yes", "yes")

accuracy(pred, actual)

Run the code above in your browser using DataLab