acc | R Documentation |
Calculates the accuracy of the model by taking the mean of the number of times
the truth, y
, equals the predicted, \hat{y}
.
acc(y, yhat)
y |
A |
yhat |
A |
The accuracy of the classification in numeric
form.
# Set seed for reproducibility
set.seed(100)
# Generate data
n = 1e2
y = round(runif(n))
yhat = round(runif(n))
# Compute
o = acc(y, yhat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.