The ML.ARIMA_EVALUATE function
This document describes theML.ARIMA_EVALUATE function, which you can useto evaluate the model metrics ofARIMA_PLUS orARIMA_PLUS_XREG time seriesmodels.
Syntax
ML.ARIMA_EVALUATE( MODEL `PROJECT_ID.DATASET.MODEL_NAME`, [, STRUCT(SHOW_ALL_CANDIDATE_MODELS AS show_all_candidate_models)])
Arguments
ML.ARIMA_EVALUATE takes the following arguments:
PROJECT_ID: Your project ID.DATASET: The BigQuery dataset that containsthe model.MODEL_NAME: The name of the model.SHOW_ALL_CANDIDATE_MODELS: aBOOLvalue thatindicates whether to show evaluation metrics or an error message for eitherall candidate models or for only the best model with the lowestAkaike information criterion (AIC).When the
SHOW_ALL_CANDIDATE_MODELSargument value isFALSE, theML.ARIMA_EVALUATEfunction returns evaluation metrics for only the bestmodel. When theSHOW_ALL_CANDIDATE_MODELSargument value isTRUE,metrics are returned for all candidate models, along with a possible fittingerror on a setting ofnon_seasonal_p,non_seasonal_d,non_seasonal_q,anddrift; this applies to both single time series training withauto.ARIMAand large-scale time series training cases.For large-scale time series forecasting training, regardless of the value ofthe
SHOW_ALL_CANDIDATE_MODELSargument, a single row is returned for atime series for which there is no a valid model. The error message explainsthe reason, and the values of all other columns areNULL.For single time series
ARIMA_PLUSorARIMA_PLUS_XREGmodels, the defaultvalue isTRUE. For large-scale time seriesARIMA_PLUSmodels, thedefault value isFALSE.
Output
ML.ARIMA_EVALUATE returns the following columns:
time_series_id_colortime_series_id_cols: the identifiers of a timeseries. Only present when forecasting multiple time series at once. The columnnames and types are inherited from theTIME_SERIES_ID_COLoptionas specified in the model creation query.non_seasonal_p: anINT64value that contains the order of theautoregressive part in a non-seasonal ARIMA model.non_seasonal_d: anINT64value that contains the degree of firstdifferencing involved in a non-seasonal ARIMA model.non_seasonal_q: anINT64value that contains the order of the movingaverage part in a non-seasonal ARIMA model.has_drift: aBOOLvalue that indicates whether the model has drift.log_likelihood: aFLOAT64value that contains thelog-likelihood of the model.AIC: the AIC of the model.variance: aFLOAT64value that contains the variance of the model.seasonal_periods: anARRAY<STRING>value that contains one or more ofthe following values:DAILYWEEKLYMONTHLYQUARTERLYYEARLYNO_SEASONALITY
has_holiday_effect: aBOOLvalue that indicates whether the history datahas a holiday effect.has_spikes_and_dips: aBOOLvalue that indicates whether the history datahas spikes and dips.has_step_changes: aBOOLvalue that indicates whether the model hasstep changes.error_message: aSTRINGvalue that contains the error message raised ifany time series fail in the model.
Thehas_holiday_effect,has_spikes_and_dips, andhas_step_changes columnsare only populated forARIMA_PLUS models that havedecompose_time_seriesenabled.
All of the columns are specific to the fittedARIMA models except for thefollowing columns:
time_series_id_coltime_series_id_colsseasonal_periodshas_holiday_effecthas_spikes_and_dipshas_step_changes
When thenon_seasonal_d value is not1,has_drift is set toFALSE bydefault, becausehas_drift doesn't apply in those cases.
Example
The following example retrieves the evaluation metrics of the best model fromthe modelmydataset.mymodel in your default project:
SELECT*FROMML.ARIMA_EVALUATE(MODEL`mydataset.mymodel`,STRUCT(FALSEASshow_all_candidate_models))
What's next
- For information about model evaluation, seeBigQuery ML model evaluation overview.
- For more information about supported SQL statements and functions for timeseries forecasting models, seeEnd-to-end user journeys for time series forecasting models.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.