I'm trying to use an LSTM network to predict a sequence of a time series variable. I'm trying to predict a sequence of 3 elements based on the sequence of the previous 6 elements. The Keras code that I'm using is the following:

model = Sequential()

model.add(LSTM(10, activation='relu', return_sequences=False, input_shape=(6, 1)))


model.compile(optimizer='adam', loss='mse')

model.fit(X, Y, epochs=50, verbose=0)

However, when I look at the predicted sequence, they have a much smaller scale compared to the expected numbers from the test sample (the expected sequence are numbers like 1, 3, 4,... whereas the predicted sequence are numbers like 0.3, 0.2, 1.002,..). When I scale the training data first, the problem becomes the other way around (namely the predicted sequence are higher than the expected). Where could be the problem?

  • $\begingroup$ You can train the model for a greater number of epochs and then allow the loss to decrease which would ultimately restore the scale. $\endgroup$ – Shubham Panchal May 9 '19 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.