Preparing data for multi-step time series forecast using LSTM
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I am trying to predict a multi-step future estimate of a certian parameter using previously logged time-series data (with just one feature)
I have two major questions relating to this:
Question 1) Let us assume I want to use the previous 500 values to get an estimate for the next 200 values. How do I prepare the input data for training the LSTM for such a case. If i enter training data of the following type, it gives me an error saying 'Sequence responses must have the same sequence length as the corresponding predictors.'
How do I solve this problem?
Question 2) Is there any other way apart from looping the predictAndUpdateState 200 times to get the predicted output for an arbitrary test data after training the network? And....is there any specific parameter to be set in the TrainingOptions for this?
for i = 2:numTimeStepsTest
[net,YPred(:,i)] = predictAndUpdateState(net,YPred(:,i-1),'ExecutionEnvironment','cpu');
end
I would really appreciate a solution to this,
Aniroodh
0 commentaires
Réponses (1)
Shivam Lahoti
le 31 Déc 2023
Hi Aniroodh,
I can understand that you want to prepare data to predict a multi-step future estimate of a certain parameter using previously logged time-series data.
For Question 1: You can try a different approach where for each training example, you select 500 consecutive values as the input and the subsequent 200 values as the output. Slide this window through your time series to create multiple such pairs. By preparing data like this you can train an LSTM network for multi-step time series forecasting.
Please refer to the prepare data section of the following documentation for more details.
Regarding Question 2: The ability to predict multiple steps at once without looping depends on how you've structured and trained your network. If your network is trained for one-step predictions, you'll need to use a loop or retrain your network to predict multiple steps at once.
I hope this was helpful.
Regards,
Shivam Lahoti.
0 commentaires
Voir également
Catégories
En savoir plus sur Sequence and Numeric Feature Data Workflows dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!