bigframes.bigquery.ml.explain_forecast#

bigframes.bigquery.ml.explain_forecast(model: BaseEstimator | str | Series, input_: DataFrame | DataFrame | str | None = None, *, horizon: int | None = None, confidence_level: float | None = None) → DataFrame[source]#

Forecasts future time series values and explains them with the separate components that make up the time series.

See the BigQuery ML EXPLAIN_FORECAST function syntax for additional reference.

Parameters:
  • model (bigframes.ml.base.BaseEstimator, str, or pd.Series) – The time series model to explain. Must be an ARIMA_PLUS model trained with the decompose_time_series option enabled, which is the default, or an ARIMA_PLUS_XREG model.

  • input (Union[bigframes.pandas.DataFrame, str], optional) – The DataFrame or query that contains the future feature values used by an ARIMA_PLUS_XREG model. ARIMA_PLUS models don’t take input data, because forecasting happens when the model is created.

  • horizon (int, optional) – An INT64 value that specifies the number of time points to forecast. The default value is 3, and the maximum value is the value of the horizon option specified in the CREATE MODEL statement, or 1000 if that option isn’t specified.

  • confidence_level (float, optional) – A FLOAT64 value that specifies the percentage of the future values that fall in the prediction interval. The default value is 0.95. The valid input range is [0, 1).

Returns:

The history and forecast time series values, along with the trend, seasonal, holiday, and other components that explain them.

Return type:

bigframes.pandas.DataFrame