How to prepare time series data for LSTM training?

19 Ansichten (letzte 30 Tage)
Marco Pizzoli
Marco Pizzoli am 12 Okt. 2023
Kommentiert: Marco Pizzoli am 16 Okt. 2023
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

Akzeptierte Antwort

Neha
Neha am 16 Okt. 2023
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!

Weitere Antworten (0)

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by