If I have say 1 year daily close price of a stock and I divide it in ratio of 80:20 as train:test data.
Now I use TimeSeriesGenerator to fit the model on train data.
After fitting the model I want to test for that I would use say last 20 records from train dataset to predict the next record inorder to compare with the first record in test dataset.
Now i wanted to ask is inorder to predict the 2nd record should I replace the last record in train data with the predicted data or first data from test dataset?
What I mean is in the below code
test_predictions =  first_eval_batch = scaled_train[-n_input:] current_batch = first_eval_batch.reshape((1, n_input, n_features)) for i in range(len(test)): # get the prediction value for the first batch current_pred = model.predict(current_batch) # append the prediction into the array test_predictions.append(current_pred) # use the prediction to update the batch and remove the first value current_batch = np.append(current_batch[:,1:,:],[[scaled_test[i]]],axis=1)
at the last line should I use