Description
The ConfusionMatrix function shows how often a classification algorithm correctly classifies items. The function takes an input tbl_teradata 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 tbl_teradata objects.
Usage
td_confusion_matrix_mle (
data = NULL,
reference = NULL,
prediction = NULL,
classes = NULL,
prevalence = NULL,
data.sequence.column = NULL
)
Arguments
data |
Required Argument. |
reference |
Required Argument. |
prediction |
Required Argument. |
classes |
Optional Argument. |
prevalence |
Optional Argument. |
data.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_confusion_matrix_mle" which
is a named list containing objects of class "tbl_teradata".
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 object(s) of class "tbl_teradata".
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"
)