Download the working file: https://github.com/laxmimerit/Google-Stock-Price-Prediction-Using-RNN—LSTM
Recurrent Neural Networks can Memorize/remember previous inputs in-memory When a huge set of Sequential data is given to it.
These loops make recurrent neural networks seem kind of mysterious. However, if you think a bit more, it turns out that they aren’t all that different than a normal neural network. A recurrent neural network can be thought of as multiple copies of the same network, each passing a message to a successor.
Different types of Recurrent Neural Networks.
Image Classification
Sequence output (e.g. image captioning takes an image and outputs a sentence of words).
Sequence input (e.g. sentiment analysis where a given sentence is classified as expressing a positive or negative sentiment).
Sequence input and sequence output (e.g. Machine Translation: an RNN reads a sentence in English and then outputs a sentence in French).
Synced sequence input and output (e.g. video classification where we wish to label each frame of the video)
### Like Facebook Page:
https://www.facebook.com/kgptalkie/
## Watch Full Playlists:
### Deep Learning with TensorFlow 2.0 Tutorials
### Feature Selection in Machine Learning using Python
### Machine Learning with Theory and Example
### Make Your Own Automated Email Marketing Software in Python
Run these lines if you get error in data_training.tail(60)
data_training = data[data['Date']<'2019-01-01'].copy()
data_test = data[data['Date']>='2019-01-01'].copy()
Actually you have an autocorrelation problem in your prediction. Pay attention to the predicted price
If we want to add date also in the model, how to use that?
say I want to provide a particular future date and the model predicts me the price of the stock on that date.
Would be so grateful if get the reply 🙂
AttributeError: 'numpy.ndarray' object has no attribute 'append'
how to fix this error?
Hello,
If the training data is having 1000000 rows in the place of 60 which number i need to take..?
Thanks
You should credit the people's work that you are using for your tutorial. If you guys are interested, a lot of the research is basically from this article posted in 2015: https://colah.github.io/posts/2015-08-Understanding-LSTMs/
for i in range(60, training_data.shape[0]):
X_train.append(training_data[i-60:i])
Y_train.append(training_data[i, 0])
I am getting following error when I run above code
KeyError Traceback (most recent call last)
c:userssaurabhpycharmprojectsstockkgpvenvlibsite-packagespandascoreindexesbase.py in get_loc(self, key, method, tolerance)
2645 try:
-> 2646 return self._engine.get_loc(key)
2647 except KeyError:
pandas_libsindex.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas_libsindex.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas_libshashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas_libshashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: (60, 0)
you are a genius!! thanks a lot. i m learning tensorflow and is the first time i understand LSTM, if you have more exercises can you share it?? Thanks!!
Plz make a video on text classification using 1D CNN
I am getting loss = nan
What could be issue
Lots of love and respect! Keep Growing!
Another question.
================
cnt,person,ForB
55590,241,0
55591,242,1
55592,243,0
55593,244,1
55594,245,1
55595,246,1
55596,247,0
55597,248,0
55598,249,0
55599,250,0
55600,251,1
55601,252,1
55602,253,0
55603,254,0
55604,255,0
55605,256,0
==================
This is part of data.
cnt is all count.
person is the person who threw the coin.
ForB means Front side or Back side.
————————————–
Depending on who throws the coin, the pattern is generated at irregular intervals.
Question 1.
The stock price forecast and the result are different, so can I apply the model?
Question 2.
What happens to the <MinMaxScaler ()> part if applicable?
Does the same apply to Binary?
Thank you.
I have followed your practice.
<data_training.tail (60)> I followed this part.
The following error message is displayed.
<AttributeError: 'numpy.ndarray' object has no attribute 'tail'>
What's wrong?
What do i need to do for nparray?
Obviously in the video, I saw that it worked.
Very nice tutorial! Can you explain how do you use the model to predict on new data after it has been validated. I am not clear on that part. Thanks
Hello, I would like to ask, If I could use this model for data where dates has gaps between, like 21/2, 23/2 and double dates like 21/2, 21/2 – for example event occurred in same day two times
how could i reprograme it to get the "future" price of stock for like 5 days. To test it out.
Great tutorial to get started. I have a few questions though.
1) Can LSTM be used if I need to predict the buy and sell dates of a stock for the next 365 days ? And which metric evaluation would be good for this scenario?
2) Will spline interpolation be best option to impute the missing data if the I have 15 years of stock data?
Thanks buddy, this is really helpful as there are many videos about the theory behind lstm and not many good ones on how to code or implement it.
I have just one problem though, I was using a random world population dataset for learning and was getting really weird numbers when multiplying the predicted output with the scale as they almost always be about 50% less than they were actually supposed to be. So I used the scaler inverse transform to get the correct output.
Could you tell why you're using the scale instead of the inverse function?
Excellent video. Can you please help me understand how we can predict the future price? I see that the prediction was done of the past data
X_Train shape (3557,60,5). I'm sorry, but I'm confused on what 60 is?