LSTM model bad forecasts
I tried to implement LSTM model for time-series prediction. Below is my trial code. This code runs without error.
metrics = ['mean_squared_error', 'mean_absolute_error', 'mean_absolute_percentage_error']
# define model
model = Sequential()
model.add(LSTM(100, activation='relu', input_shape=(n_past, 6), return_sequences=True))
model.add(LSTM(100, activation='relu', return_sequences=True))
model.add(LSTM(50, activation='relu'))
model.add(Dense(2, activation='relu'))
model.compile(optimizer='adam', loss='mse', metrics=metrics)
model.summary()
The forecast correctly predicts the peaks, but the constant values should be 0 and you cannot predict it.
However, prediction is extremely poor. How to improve the predictin? Do you have any ideas to improve it? Any ideas for improving prediction by re-designing architecture and/or layers?
Topic forecasting keras tensorflow deep-learning python
Category Data Science