I'm working on an implementation of LSTM neural network to forecast energy consumption. I have a dataset with load, series of weather parameters and indicator of it's bank holiday or not.
I first did a network with input of 24 lag (using function from this tutorial). So I have a dataset like this, but with 18 variables and from ($t_{-24}$)
var1(t-1) var2(t-1) var1(t) var2(t)
1 0.0 50.0 1 51
2 1.0 51.0 2 52
3 2.0 52.0 3 53
4 3.0 53.0 4 54
5 4.0 54.0 5 55
6 5.0 55.0 6 56
7 6.0 56.0 7 57
8 7.0 57.0 8 58
9 8.0 58.0 9 59
And I have my LSTM network:
model = Sequential()
model.add(LSTM(50, input_shape=(train_X.shape[1], train_X.shape[2])))
model.add(Dense(1))
model.compile(loss='mae', optimizer='Adam')
And currently I use var1(t-1)
and var2(t-1)
to predict var2(t)
value.
But var2
is correlated with value of var1
. I have value var1(t)
and I want to use it to predict var2(t)
, but I don't know how to do that.
I tried to fit my neural network with var1(t-1)
, var2(t-1)
and var1(t)
but it don't match with then input matrix which is (value, lagged hours, number of variables)