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>]
)
Copy

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;
Copy

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.

Key

Type

Default

Description

on_error

STRING

'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

Column

Type

Description

PREDICTION

VARIANT

Prediction results as an OBJECT containing the following keys.

Key

Type

Description

class

STRING

The predicted label with the highest probability.

probability

VARIANT

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.

LOGS

VARIANT

Contains error or warning messages.

Examples

See Examples.