title: Predict future points Feed forward neural networks
body: <p>I was able to test it but i would like to add future 30 points and forecast the data - pls advise how to add them to get the future data points</p>
  <p><a href="https://i.stack.imgur.com/nns99.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nns99.png" alt="enter image description here" /></a></p>
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from pandas import read_csv
  import math
  
  from keras.models import Sequential
  from keras.layers import Dense
  from sklearn.preprocessing import MinMaxScaler
  from sklearn.metrics import mean_squared_error
  
  # normalize the dataset
  scaler = MinMaxScaler(feature_range=(0, 1)) 
  dataset = scaler.fit_transform(dataset)
  
  # split into train and test sets
  train_size = int(len(dataset) * 0.60)
  test_size = len(dataset) - train_size
  train, test = dataset[0:train_size,:], dataset[train_size:len(dataset),:]
  
  def to_sequences(dataset, seq_size=1):
      x = []
      y = []
  
      for i in range(len(dataset)-seq_size-1):
          #print(i)
          window = dataset[i:(i+seq_size), 0]
          x.append(window)
          y.append(dataset[i+seq_size, 0])
          
      return np.array(x),np.array(y)
  
  seq_size = 35 
  trainX, trainY = to_sequences(train, seq_size)
  testX, testY = to_sequences(test, seq_size)
  
  model = Sequential()
  model.add(Dense(64, input_dim=seq_size, activation='relu')) #12
  model.add(Dense(32, activation='relu'))  #8
  model.add(Dense(1))
  model.compile(loss='mean_squared_error', optimizer='adam', metrics = ['acc'])
  print(model.summary())
  
  model.fit(trainX, trainY, validation_data=(testX, testY),
            verbose=2, epochs=100)
  
  # make predictions
  
  trainPredict = model.predict(trainX)
  testPredict = model.predict(testX)
  
  # Estimate model performance
  #SInce we used minmaxscaler we can now use scaler.inverse_transform
  #to invert the transformation.
  
  trainPredict = scaler.inverse_transform(trainPredict)
  trainY_inverse = scaler.inverse_transform([trainY])
  testPredict = scaler.inverse_transform(testPredict)
  testY_inverse = scaler.inverse_transform([testY])
  
  # calculate root mean squared error
  trainScore = math.sqrt(mean_squared_error(trainY_inverse[0], trainPredict[:,0]))
  print('Train Score: %.2f RMSE' % (trainScore))
  
  testScore = math.sqrt(mean_squared_error(testY_inverse[0], testPredict[:,0]))
  print('Test Score: %.2f RMSE' % (testScore))
  
  
  trainPredictPlot = np.empty_like(dataset)
  trainPredictPlot[:, :] = np.nan
  trainPredictPlot[seq_size:len(trainPredict)+seq_size, :] = trainPredict
  
  testPredictPlot = np.empty_like(dataset)
  testPredictPlot[:, :] = np.nan
  testPredictPlot[len(trainPredict)+(seq_size*2)+1:len(dataset)-1, :] = testPredict
  
  # plot baseline and predictions
  plt.plot(scaler.inverse_transform(dataset))
  plt.plot(trainPredictPlot)
  plt.plot(testPredictPlot)
  plt.show()
  </code></pre>
  <p>I was able to test it but i would like to add future 30 points and forecast the data - pls advise how to add them to get the future data points
  I was able to test it but i would like to add future 30 points and forecast the data - pls advise how to add them to get the future data points</p>