Stock Price Prediction And Forecasting Using Stacked LSTM- Deep Learning
Вставка
- Опубліковано 24 тра 2020
- A Machine Learning Model for Stock Market Prediction. Stock market prediction is the act of trying to determine the future value of a company stock or other financial instrument traded on a financial exchange
References: Jason Browniee Machine Learning Mastery Blogs
machinelearningmastery.com/ti...
github link: github.com/krishnaik06/Stock-...
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for a few months and I love it! www.kite.com/get-kite/?...
Please join as a member in my channel to get additional benefits like materials in Data Science, live streaming for Members and many more
/ @krishnaik06
Please do subscribe my other channel too
/ @krishnaikhindi
Connect with me here:
Twitter: / krishnaik06
Facebook: / krishnaik06
instagram: / krishnaik06
First time I understood this LSTM. You have explained the LSTM very easily and in a very crisp manner.
Easily the best video about the LSTM in UA-cam. Incredible explanation skill. Thank you for this priceless source Sir!
"Wow!!" is the word for explanation skill.
Very Impressive!!! Another gem from your treasury.
Very good one in great detail!!
Doing great job!!
Keep Posting more..
Very much impressed by the way you presented it. So simple and informative which no one shares as secret that is predicting nxt 30 days. Only few members share it in youtube. Hats off to you. Thanks and all the best for your future videos. May god bless you.
I hope you understand that the reason nobody shares the „secret“ on how to predict the next 30 days of a stock price is… that these predictions are really really bad, right? I mean you get that?
The best video that you can learn Machine Learning. Thank you for the video!
Thanks for the video. This is the first video this concept is explained really well. Now I understand the code and can use it
Krish, the best part in your teaching is... somehow, you match the audience frequency!
Thanks so much...you really explained well...from the fundamentals to the applications.
Beautifully explained...thanks a lot!!
Great achievement and proof that the stock market can be predicted. Good luck!! ✊
It can, proven, and consistently.. Search for Jim Simons.
Hi Krish Sir, thank you for such an amazing explanation. Really liked it. It helped me in my project too.
Beautiful Explanation, Thanks for video.
This made my Day. Thank you so much Sir, for this Wonderful Tutorial.More power to you.
I asked my teacher where should I start if I want to apply machine learning for stocks and he sent me this video.
You are AMAZING. Thanks a lot sir!!
Try to apply machine learning to coin toss or ask your teacher how to do that... lol.
@@rozsadnymarek5988 lol 50 percent accuracy
@@sayantanmazumdar9371 No more than in financial markets. ML is useles in forex. Believe me. I have 10 years of experience.
@@rozsadnymarek5988 Hi dis ML works in stocks market or gives a good probability ?
@@aminemihoub5269 *Unfortunately no!* You can try but you'll fail like everybody else. Sorry for destroing your wealthy dream. I tried many ultra-fancy ideas and most advanced algos and I never was able to get *stable and significant* accuracy. Stocks are a bit easier to predict, but they are also unprofitable.
Great insite, love the content. I 'd like a piece of advice though! Would you recommend using the Multi-Step LSTM model for more than one output or re-using the single output as done above?
Exactly he will cache the previous lstm cell states for that
Really, WONDERFUL . Many-many thanks sir.
hi
i have been watching some videos and so far this is the top related to this topic. keep going
I am going to implement this in my project great job sir
Very good presentation. So clear and understandable. Thankyou
excellent! Thank you. Doesn't the y_train and y_test need to be reshaped from one dimension to 2 dimensions? Or could we leave y_train and y_test as one dimension?
Thank you very much. It was very helpful.
may god give you more strength to make such valuable video man!! so grateful for you.
Hi Krish your videos are great I have learned many things from you & I would like to thank you for such a great help. Just want to know if there is any framework or tool to tune NLP models with minimal effort?
thankyou sir......nicely explained and for the code sharing
Thank you sir for making video on stock prediction.
Thanks Krish, please upload Deep Learning further videos.
very well demonstrated and useful content....
Great video man, really inspired me to make a version 2 code of predicting stock market.
Thanks for the video! Just one thing, how can we put dates in the x-axis in the graph and even future dates for prediction? Please reply!
Set the index as DATE column. And for future dates, you need to use DateOffset method in a range.
thank you very much for the video
:)
First of all , thanks for a wonderful session. One question about scaling though. Shouldn't the MinMaxScaler be used to fit_transform the training data and then use the "fitted" scaler to the test data ?
same question for me , because from jason brownlee sources , i've seen him using the scaler of fitted values on test data
I can't thank you enough for this
Hey, thank you for the video!
Is there a way to convert the last plot units to match the whole numbers rather than the decimal?
Let me congratulations first, I saw other videos that explain the same method using LSTM. However, you were the only one that made it predicting 30 days in the future, amazing! if you can make more videos like this maybe improving this method, explain it with all the details and logic behind it no matter if the video last 2 or 3 hours I'll see it. Finally an idea that you can make with this method is doing it with some other features using volume as an example and close price, instead of one feature, amazing.
Really true! I would like to have the code
Yeah I've done this with the features you r suggesting, it gave good accuracy.
@@swatigupta3173 Did you have to predict the other features as well to feed the predictions back to the model?
@@swatigupta3173 could you plese help me ?is there any way to convert those 30 values to actual stock price.
very helpful!! thanks!
Appreciate your effort;
Hi ! Thank you for your video, very useful. I have a noob question though : if you want to predict the next day's value (I mean the first value of your lst_output). Which value do you have to rely on please ? df3[1259] (or lst_output[1]), correct ?
I loved it !!
It's a good video
Thank you for this video
Hi this is a very useful video what changes do I need to make for a multivariate LSTM?
great video sir!
Hey Krish,
The video showcases the implementation of the LSTM beautifully.
It was easy, will definitely try to implement and check the result with tweaks.
Keep it up.
Thanks for the upload.
This is good from an academic point of view and learning about LSTMs and application, but I think that a lot more goes into building a robust profitable automated trading system, specially given the current situation(volatile market), anyways an informative video, keep up the good work!
Yes I also agree
@@krishnaik06 sir, can we do it for Indian market ?
Yes we can
Its doable if the data is available with a reading of 10 minutes interval of everyday from last 7 + years
Does it really require that much data??
Thanks for the video, I think the python explanation was good to understand how to put things together but I'm afraid the technical approach is very similar to the implementation of an auto-regressive model of a time series. Using only the historicity of closing prices might not be enough to have a good prediction model. Thanks anyway.
Hi Krish, at 16:03. Shouldn't that be X_test ? Why are you calling it Y_train ?
Thanks krish,
you have explained step by step anyone can easily follow.
I have gone through other videos related to stock market prediction but everybody saying don't use technique to predict regular stock market predictions
can you please suggest any specific methods that i can try for regular stock market predictions.
haha I'm reading Jasons book at the same time so this is perfect.
Did you buy jason computer vision book?
And how are jason brownlee time series books?
thanks for a wonderful explanation, could i ask you explain how to predict next unseen nth days for multivariate LSTM models?
You can also use yahoo to fetch the stocks data. It doesn't have api call restrictions
Hello my friend, thank you very much for this video. I am having a question,.. What do you think the best model for stock market prediction?
excellent explanation PROF:)
Is this possible to apply a custom loss function in a regression model ? I'm working on stock market prediction model and I need to maximize the following loss function: if [predicted] < [actual] then [predicted] else [-actual]. Would that be possible ? Thanks
Hey Sir, for the first prediction in the test data don't we need the last 100 values from the train data to have a continuous flow ?
fantastic one of the best tutorial
sir, you should have a created data-generator intend of creating the function creat_dataset it would save memory and time. Love your videos keep doing it.
Can you elaborate a bit on this?
thanks a lot!
thank you so much for this vidoes Tha
Does the library support extraction of NSE and BSE stocks too?
Thank you. 🙏🙏🙏
That is what i am looking for...great vid, will definitely try this. Thank you.
Wonderful tutorial, Krish. I appreciate your extra effort to explain the logic. You are a good teacher! I have one question, why are we seeing a discontinuity at the start of 30 days prediction?
You can't make money this way. Ask the guy how much money he made !!! He probably sell books or work for some broker. That's how they make money - by gathering more "noise traders" who pay the spread and comissions to broker.
@@rozsadnymarek5988 could you plese help me ?is there any way to convert those 30 values to actual stock price.
cool sir.
thankyou sir
Inverse _transform should be applied to y_train and y_test also before finding score as scaling was applied on these two, right ?
Thank you for this video
It is good and helpful work . I have one question since the model is predicting. why is Date /Time value a decimal number rather than Date?
great explanation
Hi, this is a good tutorial about using LSTM in Python. BUT: it is the wrong application. When you zoom into the curve, e.g. day 1150 to day 1258, you can see that the "prediction" works pretty much like a low pass filter. That means: there is a lot of delay. Also, when you compare the performance using RSME of your example to a simple 1-step delay ( predicted cost for the next day = actual cost from actual day), the 1-step delay gives better results.
adding to this comment, the 'naive' forecast should be used as a threshold performance before evaluating any ML model
Krish Sir,
while calculating the RMSE value train_predict is inverse transformed, but y_train is not inversely transformed. Same with the test data. Please clarify if I am missing something.
Thanks
Naik सर great aahat tumhi 🙏💯
excellent explanation, one question here, if we use [accuracy] option in model.fit....in time series analysis....it appears zero to all epoch....??
First comment Sir please make videos on gsoc and projects related to it to which we can contribute . I have mailed you regarding the same.. ty for such valuable contents sir...
Hey boy thanks so much meaning you from Mexico
you are the best!
Hi, Krish a question that I have is should'nt the minmax scaler be used to fit train data only and then on test set the scaler.transform() be used as otherwise it would create lookahead bias in our model?
Thanks for you video. Could you explain why scaling is important here? It doesn't make sense why it would matter since we are only using one column. If there are more than one column it makes sense since two columns have different scales but why for one column?
Because in LSTM neural networks we are using the activation function which takes only 0 and 1 that y we have to transform it 0 and 1
Hi sir can you make a vedio on web scraping through python if possible I search alot on internet but no one teaching from basic.
Thanks, actually this video explains the time series data very well. I am a bit confused that apart from Stacked LSTM, this video should not be in NLP playlist.
Amazing...In 22:43, there is a table showing model summary....Can u please explain what information does each and every entry in this table tells us.
Can you make a video on deploying a time series model using any web framework or cloud?
Great Sir
Thank you
Hi, can you tell why you didn't do inverse scaling on y_train & y_test before calculating RMSE?
If I understood your question correctly, it does not matter if we do inverse scaling or not, the RMSE value is going to be the same
hi Krish!
Great work!
I have a question, how can I get data for INR/USD.
Thanks
Amazing, can u do multivariate time series with lstm with this dataframe too please?
Thank you for your video
I have something want to ask.
So we don't need to care about metrics=['accuracy'], we only care about loss?
Thank you
Great video! Thanks.
Is it possible to use the same data for validation and test (evaluation)? I am a little bit confused and unconfortable with that, I wouldn't use the same data, I guess...
same question here
Hi Krish, Thank you for this great share. I encounter one problem : I have the exact period of AAPL stock data. I have report your line in a python doc. and at the end I have a flat prediction. Do you have an idea of that problem? my tensorflow version is 2.4.1. I have some dll error warning related to the GPU but nothing that avoid the process to complete. Thank in advance
Hi, I encountered the same problem. Have you been able to fix it? Thank you in advance.
Hi can you please take this in detail in live stream? It is very interesting big fan of your work !
Hi Krish.!
Great Info as usual.
Can you please advise how we can check accurecy of this LSTM model?
you can use MAPE
Hi Sir,
Thanks for the amazing video.
could you please help me with how should use this lstm model to create a web application.
When you compute the mean squared error you used "train_predict" thier values 200,201 (not scaling) with "y_train" thier values are scaling ( betwen -1 and 1) so you get a big value of mean_squared error
^ more people need to see this (saved me)
Yes kind of figured out when I got very large MSE and RMSE. Do you know how can this be fixed?
@@badalsoni8000 2 solutions :
- inverse scale y_train.
- scale train_predict.
@@youssefkhachaf8258 On inverse scaling y_train it shows error saying "Expected 2D array, got 1D array instead", how do we solve this?
when you run the model on scaled data, you prediction should come between 0 to 1 (in case of min max scaler ) . so you can directly use both series to calculate MSE ,MAPE
Good information stay Connect
good, very good
Dear Sir, If you are should not use for real world project then please mention the step also what kind of step should be consider in real world case study solution interms of stock prise prediction?
Please provide your valuable feedback?
@ Krish Naik sir please throw some light on multivariate time series analysis
Hi kris. In example you are showing in tiingo method calling, do we need give api_key = ‘single code’? I used auth key and it’s giving max retires exceeds with url. Any idea about this error?
Krish can you tell, what are the issues or different cases which can effect accuracy(with the dataset)
Firstly is the residual values which means the distance between observed values and response value, in other words the gradient Descent, secondly relationship between the input variables also effect the accuracy of the model. Gradient Descent tells the goodness of the model. There are other factors also looking like data leakage.