2 years ago
#43274
Mannheimer_Coder
How to reshape Data for LSTM Time Series Prediction?
values = lstm_df_w.values
n_train_weeks = len(train_set_weekly_multi)
train = values[:n_train_weeks]
test = values[n_train_weeks:,:]
# split into input and outputs
train_X, train_y = train[:, :-1], train[:, -1]
test_X, test_y = test[:, :-1], test[:, -1]
# reshape input to be 3D [samples, timesteps, features]
train_X = train_X.reshape((train_X.shape[0], 1, train_X.shape[1]))
test_X = test_X.reshape((test_X.shape[0], 1, test_X.shape[1]))
Hello Everyone, at the moment i am trying to do a multivaraite Time Series Forecasting Projekt. I managed to build a Model and to the forecast. However it is only using 1 Timestemp of the past. But i want to try different past Time Stamps for the prediction.
If i change the value to 2 i get this error message: cannot reshape array of size 2322 into shape (258,2,9)
Does anyone now how to deal with this problem?
Picture of the DF: Picture of Data
time-series
lstm
reshape
forecasting
0 Answers
Your Answer