Documentation Index
Fetch the complete documentation index at: https://mintlify.com/alexplatasl/dplbnde/llms.txt
Use this file to discover all available pages before exploring further.
accuracy computes the fraction of correctly classified observations.
Usage
Parameters
Vector of predicted class labels.
Vector of true class labels. Must be the same length as
x.Return value
A numeric scalar in [0, 1]: the proportion of predictions that match the true labels.Errors
- Throws an error if
xandyhave different lengths - Throws an error if either argument is not a character or factor vector
Examples
accuracy() evaluates on the training data when you pass the same data used for learning. For a more realistic estimate, split your data into train and test sets before running the algorithm.