I am a bit confused with the time series dataset preparation. From the internet, I saw all examples which used tree-based models, had input features and target defined as:
X = df.drop(['target'], axis=1)
y = df["target"]
i.e. we use input features and target of the same timestamp here.
While using LSTM, say with a window of x, we use input features of all x timestamps to predict the target value of (x+1) th timestamp. Suppose, if x was 1, i.e. window of size 1, we use input features of just the ith time stamp to predict target value of the (i+1) th timestamp.
While in tree based model, I end up using input features of ith time stamp to predict target value of same ith time stamp.
So should we shift the target column of tree based model by 1 and predict similar to what we do for LSTM?
Or what is the correct way to prepare the input dataset?