Alex Niemi
06/27/2024, 3:26 PMadd_history=True
. I have a dataframe, df_red
, with daily data rows, and I'm calling the forecast function as shown below with a forecast horizon, h=5
and add_history=True
.
df_fcst = nixtla_client.forecast(df_red, h=5, freq = 'B', time_col='target_date', target_col='today_close', add_history=True)
This returns the df_fcst
dataframe (screenshot below), which has a TimeGPT
forecast column. For each date/row in the TimeGPT
forecast column, does the value represent the forecast for h
periods (days in my case) from the date in the same row? E.g. Does the TimeGPT
value for 2023-08-23 represent the forecasted value for 2023-08-30 (in h=5
business days from 2023-08-23). I had assumed that it does (logical) but then came across something in the docs that seems to negate my assumption.Alex Niemi
06/27/2024, 3:27 PMh
parameter. They have a fixed horizon depending on the frequency of the data. 4. When you use add_history=True
, the output DataFrame will include both the historical predictions and the future forecasts."_Marco
06/27/2024, 3:36 PMTimeGPT
are aligned with the date. This means that the value for 2023-08-23 is the value returned by TimeGPT for the date 2023-08-23.
The add_history
parameter simply returns the fitted values of TimeGPT. It's basically the insample values. If set to False
, then only the predictions are returned.
Let me know if that answers your question!Alex Niemi
06/27/2024, 3:40 PMMarco
06/27/2024, 4:12 PMAlex Niemi
06/27/2024, 4:15 PMMarco
06/27/2024, 5:02 PMAlex Niemi
06/27/2024, 5:33 PM