I have a test data of 1025643 entries and 72 features/attributes. I have trained an lstm with input data trainX with shape (245, 30, 72) and trainY with shape (245, ). Also note that I have specified look-back to be 30 steps back hence (245, 30, 72) shape of trainX.
Now after training the model if I do
model.output_shape
The output is:
(None, 1)
What I understand is that it will give one step prediction for the test set. But I want it to be 30 rows of predictions, one for each future step, for every row in test set (like output should have shape in my case to be (1025643 , 30, 1)). What changes do I need to do with data shapes? I am using keras lstm with tensorflow backend and python 3.6.
Code for my model is:
model = Sequential()
model.add(LSTM(100, return_sequences=True, input_shape = (trainX.shape[1], trainX.shape[2])))
model.add(LSTM(100, return_sequences = False))
model.add(Dense(1, activation='linear'))
model.compile(loss='mse', optimizer='adam')
model.fit(trainX, trainY, epochs=50, shuffle=False, verbose=1)