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.
Key
Type
Default
Description
on_error
'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
Prediction results as an OBJECT containing the following keys.
Key
Type
Description
class
The predicted label with the highest probability.
probability
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
Contains error or warning messages.
Examples¶
See Examples.