# How to feed LSTM input correctly?

I have a time series problem with 15 minutes as a timestep.The complete data will be from 2016-09-01 00:00:15 to 2016-12-31 23:45:00.

I have 5 variables(v1,v2,v3,v4,v5) in the data frame and I want to predict the fifth variable (v5) for the next timestep.

I prepare the data set and prepare the information as 5-time lags. like if the time is t in the row I create the values for (t-1) to (t-5) as lags for v1 to v5 and also add two variables which are an hour and a weekday/weekend as a boolean.

So in total, I have 27 features (5 lags for 5 variable + hour + weekday/weekend). My shape of train_X is (3000, 1, 27) and train_y(3000, 1) for the 3000 observation/rows.

I also reshaped the train X like below:

train_X = train_X.reshape((train_X.shape[0], 1, train_X.shape[1]))


since I am predicting it for only one timestep at once .And then I build the model like below :

model = Sequential()