IntroNeuralNetworks icon indicating copy to clipboard operation
IntroNeuralNetworks copied to clipboard

Predition is not done for next data?

Open epraveen92 opened this issue 7 years ago • 3 comments

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.

epraveen92 avatar Dec 23 '18 14:12 epraveen92

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?

rundhik avatar Jan 25 '19 10:01 rundhik

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

guilherme-maioli avatar Mar 08 '19 17:03 guilherme-maioli

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)

robert-andrei avatar Jun 12 '19 16:06 robert-andrei