General metrics for classification models
accuracy(data, ...)# S3 method for data.frame
accuracy(data, truth, estimate, na.rm = TRUE, ...)
# S3 method for table
accuracy(data, ...)
# S3 method for matrix
accuracy(data, ...)
For the default functions, a factor containing the
discrete measurements. For the table
or matrix
functions, a table or matrix object, respectively, where the
true class results should be in the columns of the table.
Not currently used.
The column identifier for the true class results (that is a factor). This should an unquoted column name although this argument is passed by expression and support quasiquotation (you can unquote column names or column positions).
The column identifier for the predicted class
results (that is also factor). As with truth
this can be
specified different ways but the primary method is to use an
unquoted variable name.
A logical value indicating whether NA
values should be stripped before the computation proceeds