Marco,

Thanks for catching the issue.

I have modified the code.

  • Updated the logic to create the time series dataset
  • Updated the test data
  • Increased epochs from 100 to 200
  • Updated the dataset to plot the actual values

If I use the updated logic to create the time series before scaling the values and where lookback is just 1 step

First looking at the raw data

input_data[:10]

Then applying the updated logic

input_data[:10]
# time series with two inputs
lookback= 1
test_size=int(.3 * len(stock_data))
X=[]
y=[]
for i in range(len(stock_data)-lookback-1):
t=[]
for j in range(0,lookback):

t.append(input_data[[(i+j)], :])
X.append(t)
y.append(input_data[i+ lookback,1])

and then just printing first 5 values

for i in range(5):

print(str(X[i]) + " " + str(y[i]))

the output is

Please let me know if that fixes the problem

Thanks

Loves learning, sharing, and discovering myself. Passionate about Machine Learning and Deep Learning

Loves learning, sharing, and discovering myself. Passionate about Machine Learning and Deep Learning