Filter löschen
Filter löschen

LSTM time series forecasting with 3 inputs using chickenpox example

46 Ansichten (letzte 30 Tage)
jeonga ryu
jeonga ryu am 6 Mai 2019
Verschoben: KSSV am 29 Aug. 2023
Please let me know how to apply 3 inputs for the time series forecasting using LSTM example below.
chickenpox example link:
In this example, input is one(numFeatures = 1;) and I'm having trouble with changing the codes for the multiple inputs.
I'm not sure with the data input structures, and following codes for it.
It would be appreciate to provide the example or explanation about it.
Thank you.
  6 Kommentare
Hanim Basarudin
Hanim Basarudin am 7 Okt. 2020
I think you have to use con2seq() to turn the multiple variables matrix into sequential vector like what Uros has described.
https://www.mathworks.com/help/deeplearning/ref/con2seq.html
Rik
Rik am 28 Okt. 2020
Comment posted as flag by Amin mirboluki:
How can I use this?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jon Cherrie
Jon Cherrie am 2 Mai 2021
Rather than starting from the chickenpox example, you might be better off starting from the "Sequence-to-Sequence Regression Using Deep Learning" example:
In that case, the input is from 26 sensors and there is one output, an estimate of the remaining useful life of the engine.
  5 Kommentare
mhd z
mhd z am 24 Nov. 2021
Thank you for this valuable example. As you mentioned in the example, the model gets one input of each and gives one output for each one of spicies.
  • my question is that do they effect each other when the model is trained or when the data are forecasted? or the model just treats them as separate data and forecasts them? ( for example in stochastic models with exogenous serirs, the exogenous sesris help the model to model the original series more accurately. is it the same?)
  • The other question is if I I want to model (forecast) only one of them, how should I change the code? is it possible at all? ( I tried to get help from the Turbofan Engine example, I tried to change some parts of this code by copying some of adjustments in the Turbofan exampple, but I was not successful. the code does throws an error in the training section. there is only 2 time series and there is no need to miniBatch. so, by changing only the number of features and responses in the layers and options, the code should work. but it didn't. I tried with miniBatch and it did not pass the training section.)
the questions might be silly and too long, but I would be very grateful if you answer, as much as you can.
Error using trainNetwork (line 183)
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
Error in MultiVarLSTM_Pred_Ex_test (line 66)
net = trainNetwork(XTrain,YTrain,layers,options);
Caused by:
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
Imrana
Imrana am 17 Mai 2023
Hello mhd z,
Did you find your answer? I have same questions

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by