Description
The ConfusionMatrix function shows how often a classification algorithm correctly classifies items. The function takes an input table that includes two columns, one containing the observed class of an item and the other containing the class predicted by the algorithm, and outputs three tables.
Usage
td_confusion_matrix_mle ( data = NULL, reference = NULL, prediction = NULL, classes = NULL, prevalence = NULL )
Arguments
data |
Required Argument. |
reference |
Required Argument. |
prediction |
Required Argument. |
classes |
Optional Argument. |
prevalence |
Optional Argument. |
Value
Function returns an object of class "td_confusion_matrix_mle" which is a
named list containing Teradata tbl objects.
Named list members can be referenced directly with the "$" operator
using following names:
counttable
stattable
accuracytable
output
Examples
# Get the current context/connection con <- td_get_context()$connection # Load example data. loadExampleData("confusionmatrix_example", "iris_category_expect_predict") # Create remote tibble objects. iris_category_expect_predict <- tbl(con, "iris_category_expect_predict") # Example 1 - confusion_matrix_out <- td_confusion_matrix_mle(data = iris_category_expect_predict, reference = "expected_value", prediction = "predicted_value" )