필터 지우기
필터 지우기

Mutli step ahead prediction with LSTM (sequence to sequence regression)

조회 수: 1 (최근 30일)
anurag kulshrestha
anurag kulshrestha 2020년 1월 10일
편집: anurag kulshrestha 2020년 1월 10일
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개)

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by