Learn R Programming

measures (version 0.3)

ACC: Accuracy

Description

Defined as: mean(response == truth)

Usage

ACC(truth, response)

Arguments

truth

vector of true values

response

vector of predicted values

Examples

Run this code
# NOT RUN {
n = 20
set.seed(122)
truth = as.factor(sample(c(1,2,3), n, replace = TRUE))
response = as.factor(sample(c(1,2,3), n, replace = TRUE))
ACC(truth, response)
# }

Run the code above in your browser using DataLab