Test Classification Model Procedure

This procedure is generated from an activity that successfully tests a classification model. The procedure tests an existing classification model. The number of input parameters for additional tables (and schemas) can vary depending on the number of additional tables passed to the test activity. All parameters are initialized to the default values that were used by the test activity. If you use input parameters that are not the default parameters, you must ensure the new data is compatible with the original data used to build the model that is being tested.

Syntax

PROCEDURE test_class_procedure_name(
               case_table            IN VARCHAR2 DEFAULT activity_default,
               table_1               IN VARCHAR2 DEFAULT activity_default,
               table_n               IN VARCHAR2 DEFAULT activity_default,
               model_name            IN VARCHAR2 DEFAULT activity_default,
               feature_table         IN VARCHAR2 DEFAULT activity_default,
               confusion_matrix_name IN VARCHAR2 DEFAULT activity_default,
               lift_result_name      IN VARCHAR2 DEFAULT activity_default,
               roc_result_name       IN VARCHAR2 DEFAULT activity_default,
               test_metric_name      IN VARCHAR2 DEFAULT activity_default,
               drop_model            IN BOOLEAN DEFAULT user_defined
			   );

Parameters and Defaults

The procedure has two kinds of defaults:

Table 1 Build Procedure Parameters

Parameter Description
test_class_procedure_name The name specified for the procedure when the code was generated.
table_1 The name of the first additional table. The name is in the form schema_name.table_name. This parameter is optional.
table_n The name of the n-th additional table. The name is in the form schema_name.table_name. This parameter is optional.
model_name The name of the classification model being tested.
feature_table Feature ID to text mapping table generated by the text transform. Can be used to translate model detail output containing columns affected by a text transformation.
confusion_matrix_name The name of the confusion matrix created by the procedure.
lift_result_name The name of the output lift result created by the procedure.
roc_result_name The name of the output Receiver Operating Characteristics (ROC) result.
test_metric_name The name of the output test metrics created by the procedure.
drop_output A flag indicating whether to drop the output if it already exists. The value of this flag was specified when the code was generated.

Usage Notes

This procedure includes all necessary data preparation, data transformations, and model test settings. The procedure tests an existing classification model.

To generate any test result, you must specify the test_metric_name. The procedure creates all the results that are named. If you specify test_metric_name, the procedure calculates the predictive confidence value and appends the values to the output test metric table. If a confusion matrix is generated, the procedure also calculates the average accuracy and appends the value to the output test metric table.

If you don't specify a target value in the build activity, the lift and ROC are not generated even if you specify names for them.

If the test results already exists and drop_output is set to FALSE, the procedure will raise an exception to the caller and exit.

The feature table is the one generated by the Build procedure for the model that is being tested.

You can supply a feature_table name different from the default name, but you must supply the same name in both Build and Test procedures.