<model_ name>!FORECAST¶
Generates a forecast from the previously trained model model_name.
If you need to select specific columns from the data returned by this method, you can call the method in the FROM clause of a SELECT statement. See Selecting columns from SQL class instance methods that return tabular data.
语法
所需实参因作为模型训练目的的用例而异。
对于没有外生变量的单序列模型:
对于具有外生变量的单序列模型:
对于没有外生变量的多序列模型:
对于具有外生变量的多序列模型:
实参
必填:
并非每个用例都需要以下所有实参。
FORECASTING_PERIODS => forecasting_periods对于具有外生变量的预测是必需的。
预测之前的步骤数。步骤间的间隔由模型在训练期间推断。
INPUT_DATA => input_data对于具有外生变量的预测是必需的。
A reference to a table, view, or query that contains the future timestamps and values of the exogenous variables (additional user-provided features) that were passed as
input_datawhen training the model. Using a reference allows the forecasting process, which runs with limited privileges, to use your privileges to access the data. Columns are matched between this argument and the original exogenous training data by name.To create this reference, you can use the TABLE keyword with the table name, view name, or query, or you can call the SYSTEM$REFERENCE or SYSTEM$QUERY_REFERENCE function.
TIMESTAMP_COLNAME => 'timestamp_colname'对于具有外生变量的预测是必需的。
The name of the column in
input_datacontaining the timestamps.SERIES_COLNAME => 'series_colname'对于具有外生变量的多序列预测是必需的。
The name of the column in
input_dataspecifying the series.SERIES_VALUE => series对于多序列预测是必需的。
The time series to forecast. Can be a single value (e.g.,
'Series A'::variant) or a VARIANT, but must specify a series that the model has been trained on. If not specified, all trained series are predicted.
可选:
CONFIG_OBJECT => config_objectAn OBJECT containing key-value pairs used to configure the forecast job.
Key Type Default Description prediction_intervalFLOAT 0.95 大于或等于 0.0 且小于 1.0 的值。默认值为 0.95,这代表未来有 95% 的点预计会落在预测结果的区间 [lower_bound, upper_bound] 内。
on_errorSTRING 'ABORT'指定错误处理方法的字符串(常量)。这在预测多个序列时最有用。支持的值包括:
'abort': Abort the model forecasting operation if an error is encountered in any time series.'skip': Skip any time series where forecasting encounters an error. This allows forecasting to succeed for other time series. Series that failed are absent from the model output.
输出
| 列 | 类型 | 描述 |
|---|---|---|
| SERIES | VARIANT | 序列值(如果模型使用单个时间序列训练时,为 NULL)。 |
| TS | TIMESTAMP_NTZ | 时间戳。 |
| FORECAST | FLOAT | 预测目标值。 |
| LOWER_BOUND | FLOAT | 预测区间下限。 |
| UPPER_BOUND | FLOAT | 预测区间上限。 |
示例
See Examples.