I have the following dataset:
Feature 1 Feature 2 ... Feature to Predict
2015-01-01 1000 8 12
2015-01-02 1200 2 22
2015-01-03 4000 4 51
2015-01-04 2000 8 33
2015-01-05 1000 5 14
I want to predict the last feature ("Feature to predict") at time t + 1
using the previous n
timestamps. To do this I used a multivariate LSTM
that is trained using the data from t-n
to t
.
The fact is that I also have the possibility to obtain the other features ( Feature 1, Feature 2 ...) for the time 't+1' that I want to predict.
What I would like to do is to add these additional features after the LSTM
layers and before the Dense
layers and use them in the prediction of my 'Feauture to Predict'.
Right now my code, without the additional features but only with the 't-n' to 't' features, looks like this:
mdl = Sequential()
# create and fit the LSTM network
mdl.addLSTM(neuronsl1,activation = 'tanh' ,return_sequences=True, input_shape=(lags,n_features))
mdl.add(Dropout(0.2))
mdl.addLSTM(neuronsl2,activation = 'tanh' , input_shape=(lags,n_features))
mdl.add(Dropout(0.2))
--------->>> At this point i would like to add the additional features at time 't + 1'
mdl.add(Dense(neuronsl3))
mdl.add(Dense(neuronsl4))
mdl.add(Dense(1))
Any suggestions on how to do that?