Mutli step ahead prediction with LSTM (sequence to sequence regression)
1 回表示 (過去 30 日間)
古いコメントを表示
I have three explanatory variables and one dependent variable. The data is time series data. I am performing sequence to sequence regression. The data is divided into training and test dataset. I have predicted one-step ahead prediction with LSTM but i want to predict 'k' steps ahead where k=2,4,6,8. I have a trained a 'net' for 1 step ahead prediction. For 'k' steps ahead prediction, i am following this code:
net = predictAndUpdateState(net,XTrain);
[net,YPred] = predictAndUpdateState(net,YTrain(end));
I get the error 'The prediction sequences are of feature dimension 1 but the input layer expects sequences of feature dimension 3'.
As in my case XTrain is 3*n matrix while YTrain is 1*n matrix
numTimeStepsTest = numel(XTest);
for i = 2:numTimeStepsTest
[net,YPred(:,i)] = predictAndUpdateState(net,YPred(:,i-1),'ExecutionEnvironment','cpu');
end
How to proceed ahead. Please help in predicting 'k' steps ahead. Thanks in advance.
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sequence and Numeric Feature Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!