I don't know if I'm wrong or if it makes sense but, my idea is to use a single prediction and based on that one, predict the future values (I'm using a LSTM model on Keras). What I'm trying to do is:
1) Get the first X known values (initial_values)
2) Predict using initial_values and get (initial_prediction).
3) Delete the first element of initial_values and append initial_prediction
4) Repeat from step 2) X times.
My code look like this:
predictions = []
y_test_concat = []
num_steps_before = 30
# Step 1
# X_test_scaled_shape: (192, 1)
y_test_concat.append(X_test_scaled[:num_steps_before,:])
y_test_concat = np.array(y_test_concat)
y_test_concat.reshape(y_test_concat.shape[0],y_test_concat.shape[1],1)
# Step 2
simulated_predictions.append(model.predict(y_test_concat))
# Step 3 (where I get stucked)
num_steps_to_predict = 10
for i in range(1,num_steps_to_predict):
...
So during the next iterations the array should like this:
[initial_value2,initial_value3,...initial_value30, initial_prediction]
[initial_value3,initial_value4,...initial_prediction, initial_prediction2]
...
[initial_value20,initial_value21,...initial_predictionX, initial_predictionY]
Any ideas? I was wondering if there's something already implemented in Keras to do such thing using LSTM.