Prepare the data
Construct chronological windows with a fixed multi-step target horizon.
Choose the horizon. Evaluate the full forecast.
Multi-step LSTM forecasting requires a choice between direct and recursive prediction. The evaluation must simulate which observations are actually available when the forecast is issued.
Learning concept · Not a validated service
Multi-step LSTM forecasting requires a choice between direct and recursive prediction. The evaluation must simulate which observations are actually available when the forecast is issued.
A possible application for forecasting classes: Help forecasting students identify the gap between next-step prediction and multi-day planning. This extension is not delivered by the supplied starter.
Construct chronological windows with a fixed multi-step target horizon.
Train a small LSTM forecasting model and document direct versus recursive output handling.
Backtest from fixed origins and report MAE separately for each horizon against seasonal naive forecasts.
Show horizon-specific errors and forecast issue dates in a review-only report.
The supplied starter generates 240 daily values with trend, seasonality and noise. It builds lagged and shifted rolling features, trains a RandomForestRegressor on earlier rows and reports MAE on the final thirty rows.
for lag in [1, 7, 14]:
series[f"lag_{lag}"] = series["value"].shift(lag)
series["rolling_7"] = series["value"].shift(1).rolling(7).mean()
series = series.dropna()
train = series.iloc[:-30]
test = series.iloc[-30:]
model = RandomForestRegressor(n_estimators=300, random_state=42)
model.fit(train[feature_cols], train["value"])
forecast = model.predict(test[feature_cols])The source is a lag-feature random forest and does not train an LSTM. Later test rows use actual earlier test values as lag inputs. This can represent rolling one-step prediction, but not a thirty-day forecast made at a single origin. There are no prediction intervals or real operational observations.
Proposed extension: Help forecasting students identify the gap between next-step prediction and multi-day planning.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.