LSTM time series forecasting with 3 inputs using chickenpox example
28 次查看(过去 30 天)
显示 更早的评论
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
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
回答(1 个)
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
2021-11-24
Hello @Jon Cherrie
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!