| accuracy | R Documentation | 
Evaluate classification accuracy in precision and recall
accuracy(x, y)
| x | vector of predicted classes | 
| y | vector of true classes | 
class_pred <- c('US', 'GB', 'US', 'CN', 'JP', 'FR', 'CN') # prediction
class_true <- c('US', 'FR', 'US', 'CN', 'KP', 'EG', 'US') # true class
acc <- accuracy(class_pred, class_true)
print(acc)
summary(acc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.