IDAX.CONFUSION_MATRIX - Build a confusion matrix
Use this stored procedure to build a confusion matrix for classification predictions. The calculation is based on the comparison of the predictions that are made when a classification model is applied on data, and on the real values for this data.
Note: This feature is available starting from Db2®
version 11.5.4.
Authorization
The privileges held by the authorization ID of the statement must include the IDAX_USER role.
Syntax
IDAX.CONFUSION_MATRIX(in parameter_string varchar(32672))
Parameter descriptions
- parameter_string
- Mandatory one-string parameter that contains pairs of <parameter>=<value> entries that are separated by a comma.
Returned information
The number of rows that are written to the output table of the confusion matrix as a result set.
The output table that contains the confusion matrix has the following columns:
- real
- The real values of the data.
- prediction
- The predictions of the classification model for the data.
- cnt
- The frequency of a prediction for a real value.
Example
CALL IDAX.CONFUSION_MATRIX('intable=IDAX.CensusIncome_test, resulttable=CensusIncome_income_nb_ewnd, id=id, target=income,
matrixTable=ci_income_nb_ewnd_cm');