필터 지우기
필터 지우기

How to prepare time series data for LSTM training?

조회 수: 33 (최근 30일)
Marco Pizzoli
Marco Pizzoli 2023년 10월 12일
댓글: Marco Pizzoli 2023년 10월 16일
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

채택된 답변

Neha
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 CenterFile 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!

Translated by