Predicting Stock Prices - Learn Python for Data Science #4

preview_player
Показать описание
In this video, we build an Apple Stock Prediction script in 40 lines of Python using the scikit-learn library and plot the graph using the matplotlib library.

The challenge for this video is here:

Victor's winning recommender code:

Kevin's runner-up code:

I created a Slack channel for us, sign up here:

Stock prediction with Tensorflow:

Another great stock prediction tutorial:

This guy made 500K doing ML stuff with stocks:

Please share this video, like, comment and subscribe! That's what keeps me going.

and please support me on Patreon!:

Check out this youtube channel for some more cool Python tutorials:
Follow me:
Signup for my newsletter for exciting updates in the field of AI:
Рекомендации по теме
Комментарии
Автор

this is a video on learning code, not making money. the choice of the stock market as a subject is just a tool to create interest in the real subject of the video: coding ideas. I don't understand how people are so irate in this comments section about this. If the poster, or anybody, made real money with 40 lines of code... none of you would be posting here arguing about it, you'd be making money with 40 lines of code you found on a YT video. the stock market is just the frame for the idea.

KingpinRonin
Автор

This was just regression.
One can't just use regression to "predict" stock prices as everyday the parameters involved are changing.
Stock prices prediction involves a lot of different statistical concepts like Brownian Motion, Random Walk etc.
There are different models in finance like Black-Scholes equation, Monte Carlo Simulation etc. which take into account these parameters.
You have to know a decent amount of math to build a stock prediction algorithm

vedankgoyal
Автор

Dude, the way you explain the things... easily and with fun. The best teacher ever I know. Thank you for these amazing video lessons.

rushikeshdhamecha
Автор

This is a toy example. To build a system that works you would need to use Deep Reinforcement learning. And approach the stock market similar to playing a game. The system should be able to identify Good Risk to Reward setups and continuously monitor price action to ascertain whether the odds have changed. It is not enough to just predict the price action. The system should provide a good entry price a stop loss price and a profit exit price.

rameshramachandran
Автор

That's so freaky. I literally just decided to get into stock market prediction yesterday and was having trouble getting started. Perfect timing Siraj. Thank you!!

amonstr
Автор

I know this is an old video, I just wanted to compliment you on your ability to take a very complex topic, and explain it like I'm five. I've heard it said in the past that if you can't Eli 5 a topic then you don't really know it as well as think you do. However, you've displayed that you know this topic very very well. Fantastic job.

jaeen
Автор

A great video. Reading the reviews it seems a lot of poeple are missing the point. The value of your output is the enthusiasm and inspirations to seek further knowledge. Those hoping to watch a 6 minute video then make a fortune the following day will always just be dreamers.

EdwinDevey
Автор

Isn't this just overfitting? at 6:24 you can see that you've trained on the variables dates and prices and then also use them as your testing data...or is there something I'm missing?

jackeown
Автор

pandas, pd.read_csv would probably make reading the csv alot faster/ easier.

deepschoolai
Автор

Having worked in the finance industry, the answer is "no, you can't predict stock prices." The signal to noise ratio makes it so any model you train won't work for long. It's the reason why High Frequency Trading is so dominant today. You don't need to predict the price, if you just skim a few cents per share and execute hundreds of millions of transactions. Before HFT became popular, algorithmic trading made up a few percent of the trading activity. Today HFT is responsible for more than half the activity on the major exchanges. It's neat to use deep learning, but predicting stock prices isn't going to work :)

woolfel
Автор

It's just regression, not prediction

ytcio
Автор

Great appreciation and praise for his enthusiasm and clear presentation
Been through the cycles and have a little bit knowledge about the stocks, trading, investment...etc
1) Long term investment is not the short term speculation which most people engage
2) Modeling is useful only to the extend that you have all the needed data (Such as the over the counter trading, falsified data and behind curtain operations like what happened before the 2008 financial crisis)
3) The best time to make the highest return? Unfortunately, the crisis time...

JenPurple
Автор

Man, you break this down soo much better than other machine learning videos :)

pasanpawan
Автор

Just want to thank you, Siraj. Your videos are amazing...They're changing lives, for sure. Best of luck to you, and thanks again.

jonstuartjon
Автор

This is a great channel, just what I was looking for. You have a good way of bringing someone up to speed fast.

Mosfet
Автор

Really love your videos! I started watching them last night, and can't stop. Although you're a bit fast, I think it actually helps us focus on the things you say/ catch our own mistakes as we code. Great job Siraj! :) Please keep uploading more videos haha

shubhigautam
Автор

Great video series! Technically, what you said about making predictions and visualizing them is not incorrect, but it would be a good idea to note that the predictions are in-sample. We should really make out-of-sample predictions to evaluate model performance!

vman
Автор

Dude why cant all the CS guys be like you. They are always full of themselves and socially awkward af. Big fan :)

aleekazmi
Автор

I suspect accurate market prediction would change it's outcome, making it inaccurate in the end) One would have to consider consequences of selling or buying in anticipation of predicted dive/hike, possibly causing rapid bubble growth with inevitable burst, or just a total crash right away. If anything, guys down at "Wall St." would use tools to manipulate trading, actually shaping the market outcome rather than predicting it. Such software would also have to counter anything unusual, especially if it looks like trade anticipates its own activity (someone or something discovered a pattern)

klinklinom
Автор

Also, one cool way to get stock data.
symbol = 'MSFT'
df = web.DataReader(symbol, data_source='yahoo', start='2012-01-01', end='2020-01-01')
data = df.filter(items = ['Open'])

KennTollens