VivekPa / IntroNeuralNetworks

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

LSTM_model.py and MLP_model.py doesnt print #4

Open sword134 opened 4 years ago

sword134 commented 4 years ago

Hello! I am trying to figure out why neither models print any output. I ran get_prices.py and it created the correct csv file with data. I then ran preprocessing.py and again with no problems. However when I run LSTM_model.py or MLP_model-py it epochs the data and so on and finishes with no error messages, however it doesnt print anything either.

sword134 commented 4 years ago

I tried changing the bottom line of code in LSTM_model.py to this

data = pdr.get_data_yahoo("AAPL", "2017-12-19", "2018-01-12")
stock = data["Adj Close"]
X_predict = np.array(stock).reshape((1, 10, 1)) / 200

#print(model.predict(X_predict)*200)
predicter = model.predict(X_predict)*200
print(predicter)

I now get the following error "Traceback (most recent call last): File "d:\Tradingsystems\RNN\IntroNeuralNetworks-master\LSTM_model.py", line 37, in X_predict = np.array(stock).reshape((1, 10)) / 200 ValueError: cannot reshape array of size 268 into shape (1,10)"