View source: R/confusion_matrix.R
confusion_matrix | R Documentation |
Create a confusion matrix and calculate its metrics. This function is an agnostic yardstick
wrapper: it applies all yardstick
functions that are metrics used for confusion matrices without internal hard-coded function names.
confusion_matrix(data, ...)
## Default S3 method:
confusion_matrix(data, truth, estimate, na.rm = getOption("na.rm", FALSE), ...)
data |
Either a |
... |
Not currently used. |
truth |
The column identifier for the true class results
(that is a |
estimate |
The column identifier for the predicted class
results (that is also |
na.rm |
a logical to indicate whether empty must be removed |
na.rm
This 'certestats' package supports a global default setting for na.rm
in many mathematical functions. This can be set with options(na.rm = TRUE)
or options(na.rm = FALSE)
.
For normality()
, quantile()
and IQR()
, this also applies to the type
argument. The default, type = 7
, is the default of base R. Use type = 6
to comply with SPSS.
df <- tibble::tibble(name = c("Predict Yes", "Predict No"),
"Actual Yes" = c(123, 26),
"Actual No" = c(13, 834))
df
confusion_matrix(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.