I have been working on a project on the demand for a product. I am using data from 2016 to train the LSTM model. The architecture is as follows:
model_2016 = Sequential() model_2016.add(LSTM(units = 256, input_shape=(1, look_back), return_sequences = True)) model_2016.add(Dropout(0.2)) model_2016.add(LSTM(units = 128)) model_2016.add(Dropout(0.2)) model_2016.add(Dense(units = 1)) trainY = np.reshape(trainY, (len(trainY), )) valY = np.reshape(valY, (len(valY), )) opt = Adam(learning_rate=0.0005, decay=1e-6) model_2016.compile(loss='mean_squared_error', optimizer=opt, metrics=['accuracy']) hist = model_2016.fit(trainX, trainY, validation_split = 0.2, epochs=100, batch_size=10)
And the prediction of 2016 data is as follows.
The result of the prediction of 2020 demand is like the result of 2016, it seems like the LSTM model can't get the really precise value. I've checked some articles, like to modify batch size, numbers of neurons, and number of the epoch. But the results don't improve. Do you have any ideas? Appreciate it a lot!!
The following one is the model trained by data from 2016~2019
The train_validation img is as follows
And finally, it's the result of the prediction of demand in 2020
If you have any further suggestions, please tell me.