TransWikia.com

should I shift a dataset to use it for Time series regression with RNN/LSTM?

Data Science Asked by basilisk on January 9, 2021

I’m seeing this tutorial to know how to use LSTM to predict time series data and I noticed that he shifted the target/labels up so that the features are all in time t but the target is t+1

so my simple question is, should we always do this when working with time series data?

I have a time series data and I want to use it to build a regression model with RNN. I used feed forward NN first but it didn’t work good enough so I decided to use RNN/LSTM. My question is should I let the dataset as it is now where every row have features and target at time t or should I shift the target column so that the features would always be at time t but the target is always shifted(t+1) ahead?

One Answer

Yes, you are making prediction, which means using historical features(such as at time t) to predict the target in the future(say t+1). In many cases, you could use past few timestamps' features(say t-n,t-n+1,...t) to predict. Preprocess your data in the way (X_historical,y_future) in case of data leakage.

Answered by chzhrr on January 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP