The ML.HOLIDAY_INFO function
This document describes the ML.HOLIDAY_INFO
function, which you can use to
return the list of holidays being modeled by an
ARIMA_PLUS
or
ARIMA_PLUS_XREG
time series forecasting model. The function returns the list of holidays only
if it detects a holiday effect in the model. Otherwise, the function returns
an empty result set.
Syntax
ML.HOLIDAY_INFO(MODEL `project_id.dataset.model`)
Arguments
ML.HOLIDAY_INFO
takes the following arguments:
project_id
: Your project ID.dataset
: The BigQuery dataset that contains the model.model
: The name of the model.
Output
ML.HOLIDAY_INFO
returns the following columns:
region
: aSTRING
value that identifies the holiday region.holiday_name
: aSTRING
value that identifies the holiday.primary_date
: aDATE
value that identifies the date the holiday falls on.preholiday_days
: anINT64
value that identifies the start of the holiday window around the holiday that was taken into account when modeling.postholiday_days
: anINT64
value that identifies the end of the holiday window around the holiday that was taken into account when modeling.
Example
The following example returns the results for a model that uses a custom holiday:
SELECT * FROM ML.HOLIDAY_INFO(MODEL `mydataset.arima_model`);
The output looks similar to the following:
+-----------------------+--------------+-----------------+------------------+ | region | holiday_name | primary_date | preholiday_days | postholiday_days | +--------------------------------------------------------+------------------+ | US | Members day | 2001-10-21 | 3 | 1 | +-----------------------+--------------+-----------------+------------------+ | US | Members day | 2002-10-22 | 3 | 1 | +-----------------------+--------------+-----------------+------------------+ | US | Members day | 2003-10-21 | 3 | 1 | +-----------------------+--------------+-----------------+------------------+ | US | Members day | 2004-10-23 | 3 | 1 | +-----------------------+--------------+-----------------+------------------+
What's next
- For information about model evaluation, see BigQuery ML model evaluation overview.
- For information about the supported SQL statements and functions for each model type, see End-to-end user journey for each model.