5-Days Lead forecasting with LSTM

Hello, I have worked on a problem and used LSTM explained following.
To be clear with my question let me explain the problem I am working on. I have 200 water level timeseries data of river. And I have successfully run the LTSM code which can predict one step ahead forecasting (i.e. as per my knowledge when testing, if I give todays water level data it will predict the next days value).
But I want to it to predict 5 step ahead (i.e. when testing, if I give todays water level data it will predict the value for 5th day)

回答 (1 件)

Anay
Anay 2025 年 4 月 3 日

0 投票

Hi Foysol,
I understand that you want to train a LSTM model to predict output 5 steps ahead. The example you are currently referring to shows how to train an LSTM model to predict a single element ahead in the sequence.
You can predict next 5 outputs by utilizing the “Closed loop forecasting” method where in order to predict output for time steps t to t + k, you need to have true value for the time step t - 1 only. Then, to make prediction for step i, use the predicted value for time step i – 1 as input.
numPredictionTimeSteps = 5; %Predict for next 5 time steps
Y = zeros(numPredictionTimeSteps,numChannels);
Y(1,:) = Z(end,:);
for t = 2:numPredictionTimeSteps
[Y(t,:),state] = predict(net,Y(t-1,:));
net.State = state;
end
You can refer to the “Closed loop forecasting” section of the “Sequence Forecasting Using Deep Learning Example” by following the below link:
I hope this resolves the issue!

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2021 年 1 月 4 日

回答済み:

2025 年 4 月 3 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by