LSTM time series forecasting with 3 inputs using chickenpox example

21 ビュー (過去 30 日間)
jeonga ryu
jeonga ryu 2019 年 5 月 6 日
移動済み: KSSV 2023 年 8 月 29 日
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 件のコメント
Hanim Basarudin
Hanim Basarudin 2020 年 10 月 7 日
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 2020 年 10 月 28 日
Comment posted as flag by Amin mirboluki:
How can I use this?

サインインしてコメントする。

回答 (1 件)

Jon Cherrie
Jon Cherrie 2021 年 5 月 2 日
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 件のコメント
mhd z
mhd z 2021 年 11 月 24 日
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 2023 年 5 月 17 日
Hello mhd z,
Did you find your answer? I have same questions

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by