You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Skforecast for the first time and I am having trouble forecasting steps which is larger than the number of lags. Below is my sample dataframe with 13 historic values
self = =================
ForecasterAutoreg
=================
Regressor: XGBRegressor(base_score=0.5, booster='gbtree', col...1, 'verbosity': 0}
Creation date: 2022-06-10 11:17:54
Last fit date: 2022-06-10 11:17:54
Skforecast version: 0.4.3
steps = 6, last_window = array([77.]), exog = None
def _recursive_predict(
self,
steps: int,
last_window: np.array,
exog: np.array
) -> pd.Series:
'''
Predict n steps ahead. It is an iterative process in which, each prediction,
is used as a predictor for the next step.
Parameters
----------
steps : int
Number of future steps predicted.
last_window : numpy ndarray
Values of the series used to create the predictors (lags) need in the
first iteration of prediction (t + 1).
exog : numpy ndarray, pandas DataFrame
Exogenous variable/s included as predictor/s.
Returns
-------
predictions : numpy ndarray
Predicted values.
'''
predictions = np.full(shape=steps, fill_value=np.nan)
for i in range(steps):
> X = last_window[-self.lags].reshape(1, -1)
E IndexError: index -2 is out of bounds for axis 0 with size 1
The text was updated successfully, but these errors were encountered:
I think I know whats happening, it would be great to get a confirmation. The training window is set by length_of_dataset - num_of_lags so in my case my dataset size was 13 and my lag was 12. So only 1 value was being added to the last window. Is that understanding right?
I am using Skforecast for the first time and I am having trouble forecasting steps which is larger than the number of lags. Below is my sample dataframe with 13 historic values
Python Version: 3.8
skforecast version: 0.4.3
Forecaster Object after fitting
Code used for fitting and prediction
Error:
The text was updated successfully, but these errors were encountered: