## Predicting Stock Prices – Learn Python for Data Science #4

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:
https://github.com/llSourcell/predicting_stock_prices

Victor’s winning recommender code:
https://github.com/ciurana2016/recommender_system_py

Kevin’s runner-up code:
https://github.com/Krewn/learner/blob/master/FieldPredictor.py#L62

https://wizards.herokuapp.com/

Stock prediction with Tensorflow:
https://nicholastsmith.wordpress.com/2016/04/20/stock-market-prediction-using-multi-layer-perceptrons-with-tensorflow/

Another great stock prediction tutorial:
http://eugenezhulenev.com/blog/2014/11/14/stock-price-prediction-with-big-data-and-machine-learning/

This guy made 500K doing ML stuff with stocks:

and please support me on Patreon!:
https://www.patreon.com/user?u=3191693

Check out this youtube channel for some more cool Python tutorials:
Signup for my newsletter for exciting updates in the field of AI:
https://goo.gl/FZzJ5w

Source

### Comment List

• Siraj Raval
December 14, 2020

Is it racist that your voice REALLY surprised me lol great video man ty!

• Siraj Raval
December 14, 2020

This is a great video. I am using it in my own website about this topic here: https://binbitforex.site/forecasting-stock-prices/

• Siraj Raval
December 14, 2020

I learned a lot from your series when I was a student. now I work at a trading fund and use ML for actual trading… it is not your expertise for sure lol and your modeling is completely wrong. please do what you do better

• Siraj Raval
December 14, 2020

on line 43 I got a bug
what is it? predicted)price = …. predicted_price = ….. or something else?

• Siraj Raval
December 14, 2020

Where is the prediction? All you did was do the regression of the data. Overfiting the model completly. What I am. Missing?

• Siraj Raval
December 14, 2020

neat but just play

• Siraj Raval
December 14, 2020

Me and my Friends are using auvoria prime for last 30 days almost and we are very happy. it is making 20% Monthly Return on our investment . you can Buy on this link Now — https://auvoriaprime.com/register/apinferno15

if you need any help then reply to my comment and leave your contact detail. will help you to setup this MONEY Making machine

• Siraj Raval
December 14, 2020

@@@@@@@@@@@@@@@@Hello, my name is Nagesh Dubey and I am the owner of the "Golden Games" company. I want to talk to you about our company's business cooperation. Please contact me! You will get rich returns, and our company guarantees that you can get commissions every day. (Telegram) APP account +91 70913 55779

• Siraj Raval
December 14, 2020

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

• Siraj Raval
December 14, 2020

Good

• Siraj Raval
December 14, 2020

pete

• Siraj Raval
December 14, 2020

You need to split the training and testing data bro

• Siraj Raval
December 14, 2020

So what was the prediction?

• Siraj Raval
December 14, 2020

Hello Siraj brother, how you become so expert in machine learning and data science stuff. Please guide me how should I learn. You are awesome. You look so confident I don't know how you are doing that. How you easily see problems and solves them in minutes. Please brother I am newbie from India to this field, having experience in programming.

• Siraj Raval
December 14, 2020

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'])

• Siraj Raval
December 14, 2020

One of the best courses I have taken on my career-building Python skills to succeed as a data scientist.
https://www.datacamp.com/tracks/data-scientist-with-python?tap_a=5644-dce66f&tap_s=841152-474aa4

With no prior coding experience in Python, I learn how easily this language allows you to import, clean, manipulate, and visualize dataâ€”all integral skills for any aspiring data professional or researcher.

I would recommend all my linked connections with similar interests looking to boost their Python skills and wanting to begin their journey to becoming a confident data scientist should try out this awesome course by DataCamp.

You guys can follow me on my social media profiles for the projects i have done as a data scientist.

• Siraj Raval
December 14, 2020
• Siraj Raval
December 14, 2020

Am I the only lunatic here, or you just can do that in excel without a single line of code.??

• Siraj Raval
December 14, 2020

So energetic! and so oversimplified. I love your videos, but it's true. Keep up the good work. you teach people the basics, You're not the only click-baiter on younube

• Siraj Raval
December 14, 2020

the original source of the code is ::: https://github.com/chaitjo/regression-stock-prediction/blob/master/svr.py
what a theife

• Siraj Raval
December 14, 2020

this is the last time i watch this shit… siraj made great videos but with these stock market videos he is shitting his chennal

• Siraj Raval
December 14, 2020

man you should make fundamental analysis with other factors like economic calendar and economic news ….
how this can possible work??? it just take the open price to predict the open prices….

• Siraj Raval
December 14, 2020

very good video

• Siraj Raval
December 14, 2020

i think this guy trying to be zayn malik

• Siraj Raval
December 14, 2020

Cool video, are u high? Better! Haha

• Siraj Raval
December 14, 2020

really appreciate mike harry for his amazing stock strategy this past 5 months it has been indeed a huge success and very profitable.

• Siraj Raval
December 14, 2020

bullshit, you know nothing.

• Siraj Raval
December 14, 2020

Hi siraj ,my name is nitish and i m from India , actually i m using above code but getting error while using get data in python 377
Will you plZ help me with that