VivekPa / IntroNeuralNetworks

Introducing neural networks to predict stock prices
MIT License
735 stars 207 forks source link

Predition is not done for next data? #2

Open epraveen92 opened 5 years ago

epraveen92 commented 5 years ago

Hi,

The prediction was only with the actual data and there is no data predicted for next few data or days.

What you done is "If the data was 1000 then the predicted also 1000".

But I'm asking is predicted data for next n number of days.

For example: if we have 1000 data and we need to predict for next 10 days then it should be predicted for 1010 data.

rundhik commented 5 years ago

Hi, thanks for your project

when i try to run code I saw warning

ValueError                                Traceback (most recent call last)
<ipython-input-16-cd38cb954793> in <module>()
     35 data = pdr.get_data_yahoo("AAPL", "2017-12-19", "2018-01-03")
     36 stock = data["Adj Close"]
---> 37 X_predict = np.array(stock).reshape((1, 10, 1)) / 200
     38 
     39 print(model.predict(X_predict)*200)

ValueError: cannot reshape array of size 9 into shape (1,10,10)

What should i do?

guilherme-maioli commented 5 years ago

Hi, thanks for your project

when i try to run code I saw warning

ValueError                                Traceback (most recent call last)
<ipython-input-16-cd38cb954793> in <module>()
     35 data = pdr.get_data_yahoo("AAPL", "2017-12-19", "2018-01-03")
     36 stock = data["Adj Close"]
---> 37 X_predict = np.array(stock).reshape((1, 10, 1)) / 200
     38 
     39 print(model.predict(X_predict)*200)

ValueError: cannot reshape array of size 9 into shape (1,10,10)

What should i do?

I need help too with the same error

robert-andrei commented 5 years ago

Hi, thanks for your project

when i try to run code I saw warning

ValueError                                Traceback (most recent call last)
<ipython-input-16-cd38cb954793> in <module>()
     35 data = pdr.get_data_yahoo("AAPL", "2017-12-19", "2018-01-03")
     36 stock = data["Adj Close"]
---> 37 X_predict = np.array(stock).reshape((1, 10, 1)) / 200
     38 
     39 print(model.predict(X_predict)*200)

ValueError: cannot reshape array of size 9 into shape (1,10,10)

What should i do?

The solution is to change the parameters for pdr.get_data_yahoo. As it is now, in that interval are only 9 working days, so only 9 stock values. You could, for example, use the following setup:

data = pdr.get_data_yahoo("AAPL", "2017-12-19", "2018-01-04)