How can i retrain LSTM for each new prediction using keras?

Viewed 622

When i run my trained lstm on the test data it predicts all of it at once without retraining on each new prediction, but since i am working with time series this is necessary for my work. Isn't there a built-in function in keras for this type of prediction?

1 Answers

Predictions cannot retrain your model. In predictions you need to give a sample and the model will return the output. In training you need to give both sample and the output.

In time series you can predict tomorrow's value and train the model on today's value:

model.fit(yesterday_features, today_output)
tomorrow_pred = model.preict(today_features)
Related