How can I get the predict future following value using Tensorflow LSTM?

Thank you for reading. I'm not good at English.

I am wondering how to predict and get future time series data after model training. I would like to get the values after N steps.

So, I used the time series in the Tensorflow tutorial to practice predicting the model.

a = y_val[-look_back:] 
for i in range(N-step prediction): #predict a new value n times.
    tmp = model.predict(a.reshape(-1, look_back, num_feature)) #predicted value     
    a = a[1:] #remove first     
    a = np.append(a, tmp) #insert predicted value

The results are predicted by linear graphs from nonlinear graphs as shown below.

How can I get the actual, right solution? or Is Tessorflow impossible to predict multiple steps?

full source (After the 25th line is my code.)

epoch=100

Topic predict lstm tensorflow deep-learning python

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.