model_name!PREDICT

Generates a classification prediction from the previously trained model model_name.

Syntax

<model_name>!PREDICT(
    INPUT_DATA => <input_data>,
    [CONFIG_OBJECT => <config_object>]
)

Arguments

Required

INPUT_DATA

An OBJECT containing key-value pairs that map feature names to their values. Use wildcard expansion in an object literal to automatically create key-value pairs from a table, as in:

SELECT model_binary!PREDICT(INPUT_DATA => {*})
    as prediction from prediction_purchase_data;

The feature names in the object must match the names and types specified at training time. Missing or extraneous features are ignored.

Optional

CONFIG_OBJECT

An OBJECT whose key-value pairs specify additional training options.

KeyTypeDefaultDescription
on_errorSTRING'ABORT'

String (constant) that specifies the error handling method for the model inference task. Supported values are:

  • 'ABORT': Abort the entire prediction operation if any row results in an error.
  • 'SKIP': Skip rows that result in an error. The error is shown instead of the results.

Output

KeyTypeDescription
classSTRINGThe predicted label with the highest probability.
probabilityVARIANTAn OBJECT containing the probabilities of each predicted class. For each class, the key is the class name, and the value is the predicted probability of the class.
KeyTypeDescription
classSTRINGThe predicted label with the highest probability.
probabilityVARIANTAn OBJECT containing the probabilities of each predicted class. For each class, the key is the class name, and the value is the predicted probability of the class.An OBJECT containing the probabilities of each predicted class. For each class, the key is the class name, and the value is the predicted probability of the class.
probabilityVARIANTAn OBJECT containing the probabilities of each predicted class. For each class, the key is the class name, and the value is the predicted probability of the class.An OBJECT containing the probabilities of each predicted class. For each class, the key is the class name, and the value is the predicted probability of the class.
LOGSVARIANTContains error or warning messages.

Examples

See Examples.