Stock Price Prediction Using Python & Machine Learning

preview_player
Показать описание
Stock Price Prediction Using Python & Machine Learning (LSTM).
In this video you will learn how to create an artificial neural network called Long Short Term Memory to predict the future price of stock.

Disclaimer: The material in this video is purely educational and should not be taken as professional investment advice. Invest at your own discretion.

NOTE: Some errors in the video:
(1) In the video to calculate the RMSE I put the following statement:

When in fact I meant to put:

You can also use the following statements to calculate RMSE:

(2) The preprocessing of data using MinMaxScaler resulted in data leakage, leading to the creation of future bias. Despite this, the code can still be utilized to obtain a basic understanding of Neural Network implementation in Python for classification and prediction purposes.

Please Subscribe !

⭐Get the code here⭐:

⭐Please Subscribe !⭐

⭐Support the channel and/or get the code by becoming a supporter on Patreon:

⭐Websites:

⭐Helpful Programming Books
► Python (Hands-Machine-Learning-Scikit-Learn-TensorFlow):

► Learning Python:

►Head First Python:

► C-Programming :

► Head First Java:

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
📚Helpful Financial Books📚
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
🌟Stock Market Investing Books:
✔️The Bogleheads' Guide to Investing
✔️The Intelligent Investor
✔️A Random Walk Down Wall Street

🌟Money Mindset Books
✔️Rich Dad Poor Dad:
✔️Get Good With Money: Ten Simple Steps To Becoming Financially Whole:

#StockPrediction #Python #MachineLearning
Рекомендации по теме
Комментарии
Автор

I have seen 1000+ videos, read 1000+ articles on the internet. The best of the videos I have ever seen on machine learning.

rajeshdua
Автор

The flaw nobody seems to have realized is that it’s predicting 1 day in the future GIVEN the last 60 days of actual values. So each prediction on the graph is actually using the validation data from yesterday + the NN prediction for today. Anyone can now see why it tracks the chart so accurately. I could get the same chart with a random number generator.
Caveat emptor.

snivesz
Автор

For anyone criticising the effectiveness of this algorithm...you are missing the point. This is a very good FREE tutorial on applying LSTM & RNN to real world datasets using python, for learning purposes only. It's a standard and basic learning topic for Neural Networks. To criticise this would be same as saying Man City should win UCL every year based on their FIFA20 stats...

yx
Автор

40:03 It is meaningless and misleading to plot predictions (especially zoomed out) unless you do out-of-sample forecasting. Many people are just obsessed with plotting forecast curves and comparing them with actual curves. It has got to stop! You can get a better fit by predicting the next value to be the current value. Out-of-sample forecasting is when the model is forced to predict N steps successively while not being provided with the true values of the previous time steps. Over time, errors would accumulate and the prediction curve would sway away from the actual curve. Only if you are doing out-of-sample forecasting, it makes sense to plot.

touriafransform
Автор

I recreated this exact model and then checked to see how often the simple up/down movement of the price was correct (never mind the actual change amount), it couldn't reliably get better than 50% so it's basically the same thing as randomly guessing a slight up or down movement. So this was a cute demonstration of the concept but you'll definitely lose your ass if you tried to trade on anything like this haha. You need a vastly more complex model to start consistently getting higher than 50% and even then if there are large market corrections, they will definitely break your model. So Something like this might give you some minor assistance in day trading but you wont get rich one it. But anyways, we certainly appreciate the explanation on how general LSTM model functions

alexroseland
Автор

This is the best video of LSTM I saw. I don't understand why do some people dislike this video ?

LovingLego
Автор

I wouldn't put much store in the model created to be honest for reasons others have raised about scaling but as a 'get you going' video into the perilous world of trading using ML then it's an honest attempt - well done.

MrBobtwang
Автор

one change that can be done here is increasing epochs if your ram can handle, because that would increase accuracy. Great video!

mikethecoder
Автор

Wonderful tutorial! Thank you very much for making it. I am making a project to impress the interviewer at the potential working place. I already did a prediction model using ML and Python but it was a simple Linear regression model. Thank you for your work. My model works perfectly. The only thing I can't figure out is how to trained it connected to timestamp. But otherwise it works. My tiny laptop CPU almost melted counting 38 000 rows of data XD

merrymouse
Автор

Great, but there is one small thing you missed which may introduce bias into your model. To avoid leakage from the test set into the training set, it is important to split the data before applying any preprocessing steps. This is because the preprocessing steps can introduce information from the test set into the training set, leading to overly optimistic performance estimates and poor generalization performance on unseen data.
so you have to split the data before scaling

InsightsbyMahmoud
Автор

The script here is in the right direction, naturally it needs two key columns: Add high/low/volume variables, since it represents people's sentiment and join a new dataset from other currencies. I would say low performance coins with the highest ones is a good combination.

oy_oy
Автор

I think this model is good for practice but not for real use. 1st issue is the scaling, you should scale based on the training set, not the full dataset, 2nd issue is the test dataset, the prediction works if you know the previous 60 days of the data for all the testing set. It would be good to see how is the performance of predicting next days (1+ days) just using a single vector of previous 60 days.

natih
Автор

I’m always enjoy and bless the people like you who teaching cool stuff

AMA_RILDO
Автор

Absolutely amazing video, I have finally realised that as a beginner in the financial investment market, you can achieve close to nothing yourself because you still have a lot to learn. Trading with a professional broker is more profitable and my advice for beginners is to always take advantage of that.

mariahhayes
Автор

Amazing video. It went thru everything from start to finish and explained it very clear and was easy to understand what was exactly going on and how things worked. Thanks for such a great video.

jjpmip
Автор

The video was great, saved me a lot of time trying to figure it out myself. Also learn how to use the python syntax. On a side note, back of the envelope calculations. dec 17, 19 aapl = 70.1, dec 17, 09 appl = 6.85. (70.1-6.85)/6.85 = 9.233 or 923% return over 10 years, 923%/10yr = 9.23%/year, 9.23%/365 days/yr = 0.0253%/day. If we use the previous day closing as an estimate plus the average daily change then, 70.1*(1.000253) = 70.118, accounting for the 1 to 4 stock split the price on the 18th is estimated at 70.1177 x 4 = 280.47, act close 279.74, vs AI 263.66. Would have been interesting to see which one would be better est, previous Close +% or AI, with the standard error.

icutoo
Автор

The comment at the end is priceless, "...off by a little bit." Go back and look at the price action from the end of August 2019 until about mid Jan 2020 and you'll see why this prediction of a 6% drop in the closing price is surprising. It would be nice if there had been some explanation of why the prediction was so far off and how to improve the result.

sabashioyaki
Автор

This video helped me a lot. I was struggling with the inputs to the Conv. Turns out it just required simple 3d inputs to fit and another 3d array input to predict

arcsaber
Автор

I think I have seen every tutorial on YouTube for predicting the extrapolated price of stock and i found it in your video
Thanks a lot for your time

malepatirahul
Автор

Data Science 101 : Never scale your data set with a test or validation set.
You can't scale the entire dataset which introduces significant leakage to your model.

kyucho