@@ -880,6 +880,7 @@ def forecast(
880880 id_cols : Iterable [str ] | None = None ,
881881 horizon : int = 10 ,
882882 confidence_level : float = 0.95 ,
883+ output_historical_time_series : bool = False ,
883884 context_window : int | None = None ,
884885) -> dataframe .DataFrame :
885886 """
@@ -914,6 +915,15 @@ def forecast(
914915 confidence_level (float, default 0.95):
915916 A FLOAT64 value that specifies the percentage of the future values that fall in the prediction interval.
916917 The default value is 0.95. The valid input range is [0, 1).
918+ output_historical_time_series (bool, default False):
919+ A BOOL value that determines whether the input data is returned
920+ along with the forecasted data. Set this argument to TRUE to return
921+ input data. The default value is FALSE.
922+
923+ Returning the input data along with the forecasted data lets you
924+ compare the historical value of the data column with the forecasted
925+ value of the data column, or chart the change in the data column
926+ values over time.
917927 context_window (int, optional):
918928 An int value that specifies the context window length used by BigQuery ML's built-in TimesFM model.
919929 The context window length determines how many of the most recent data points from the input time series are use by the model.
@@ -945,6 +955,7 @@ def forecast(
945955 "timestamp_col" : timestamp_col ,
946956 "model" : model ,
947957 "horizon" : horizon ,
958+ "output_historical_time_series" : output_historical_time_series ,
948959 "confidence_level" : confidence_level ,
949960 }
950961 if id_cols :
0 commit comments