How to prepare time series data for LSTM training?
28 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I want to train an LSTM network model on the basis of time series (with Deep Learning Toolbox©). The process to be modeled is single-input-single-output.
I have available the time series of input u(t) and the time series of output y(t).
My doubt is as follows, before I start training with the trainNetwork function, should I preprocess the data by shifting as follows
input = u(1:end-1);
output = y(2:end);
or can I provide the u(t) and y(t) series directly as follows?
input = u(1:end);
output = y(1:end);
Thank you very much in advance for the support.
Marco
0 件のコメント
採用された回答
Neha
2023 年 10 月 16 日
Hi Marco,
I understand that you want to know how to prepare time series data for an LSTM network given two different time series for input and output. Generally, the shifting is done within a single array "X" where it's assumed that the output at time "t" is dependent on the input at time "t-1". This is a common setup for autoregressive models where you're predicting future values of a sequence based on its past values. The same has been demonstrated here:
Since you have two different time series and assuming that your output at time "t" is directly correlated with the input at the same time "t", you can use the sequences as they are (the second approach). But if you're trying to predict "y(t+1)" based on "u(t)", you would shift your "y" sequence (the first approach).
Hope this helps!
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sequence and Numeric Feature Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!