Keras LSTM: introducing already known * future * values ​​into the forecast

I built LSTM In Keras to predict future time series values ​​from the arrogant time index input.

However, there is a unique requirement: at certain points in time in the future, we know with certainty what some values ​​of the input series will be. For instance:

model = SomeLSTM()
trained_model = model.train(train_data)
known_data = [(24, {feature: 2, val: 7.0}), (25, {feature: 2, val: 8.0})]
predictions = trained_model(look_ahead=48, known_data=known_data)

Which will train the model up to time t(end of training) and predict the time of 48periods of time from time to time t, but substituting the known_datavalues ​​for feature2 at times 24and 25.

How exactly can I explicitly paste this into LSTM?

For reference, here is the model:

model = Sequential()
model.add(LSTM(hidden, input_shape=(look_back, num_features)))
model.add(Dropout(dropout))
model.add(Dense(look_ahead))
model.add(Activation('linear'))

LSTM, . Keras, , LSTM state, , t ( ).

+4

Source: https://habr.com/ru/post/1680709/


All Articles