3

I want to forecast, for example, k next points of a time series using LSTM in Keras. I construct a data set starting from the beginning of a list containing all the points by selecting 0:p-1 points as input features and next k points i.e. p:p+k-1 as the output features. I continue this procedure by taking 1:p as input features and ... Finally I get two dataframes X, input data which is txp and y, output data which is txk. So, my problem has many-to-many structure based on here.

X = X.values.reshape(X.shape[0], 1, X.shape[1])
y = y.values.reshape(y.shape[0], 1, y.shape[1]) 

and then the first layer of my network is:

model.add(LSTM(neurons, input_shape=(X.shape[1], X.shape[2]), return_sequences=True))

But here the time step is 1. My question is that how I can increase timesteps. Should I replicate some of the rows in X and y? Am I doing it correctly?

Morteza Mashayekhi
  • 934
  • 11
  • 23
  • 1
    I found the answer in the below link. I put the link just for future reference: https://groups.google.com/d/msg/keras-users/9GsDwkSdqBg/kV1Ep9E_BAAJ – Morteza Mashayekhi Jun 07 '17 at 18:04

0 Answers0