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!