Predict Stock Prices Using Machine Learning and Python

preview_player
Показать описание
Predict Stock Prices Using Machine Learning and Python.
In this video I used 2 machine learning models to try and predict the price of stock.

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

Please Subscribe !

▶️ Get 4 FREE stocks (valued up to $1600) on WeBull when you use the link below and deposit $100:

▶️ Earn $10 in Bitcoin by signing up with BlockFi and depositing $100 or more:

►Website:

►Become a Supporter and or get the code & data set on Patreon :

►Python (Hands-Machine-Learning-Scikit-Learn-TensorFlow):

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
📚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:
Рекомендации по теме
Комментарии
Автор

I'm a noob, started my very first programming through this video. Thank you for the tutorial. This could be my first step in doing programming!

akuntugasrifqi
Автор

I really appreciate your work. You offer hope to those seeking for opportunities during these challenging times. Keep the good word coming!

mardibenton
Автор

These models seems to be giving different predictions each time I compile them! ( at least two or three pattern! ) I'm running everything in local host jupyter notebook.

sillyboy
Автор

The problem is that you shuffle the data with "train_test_split". So it means that you are testing the prediction on the data you already trained on (data leakage). So the model already know the exact answer. You can randomly see perfect fit on the prediction vs the valid one. When you dont shuffle the data, you never train on the test data, then the result is totally different (bad). But thank you for this video, its a good starting point for basic regression model.

Larussiecestlavie
Автор

Predicted past prices are the same values used for training, so don't let that confuse you, of course the predictions seems to be kinda close to the actual close prices they have been used to train the model. Try to hold the last 50 values from training and you'll see by yourself that (of course) the predictions will be much worse. Price prediction is a very difficult to predict, expecially with a simple single variable regression model. PS: i tried multivariate with RSI and bollinger bands too and it dint't help that much. That would be great to try experimenting with LSTM or some kind of RNN.
Cheers y'all

Marco-cxgp
Автор

At about 13:18 - shouldn't the x_future be the last 25 days. Could you please explain - why you are removing it?

saraleo
Автор

How much hard work you would have done to make this complex phenomenon into very simple way of narrated it.
Hats off to you. Great salute for your valuable videos.
Never in my life i imagined i could follow your videos and might be able to predict stock prices so simply.
If i make any money definitely i contribute my share money eiyh you.
Thanks sir.
May god bless you and your near and dear ones also.
Bye bye now.

loganathansiva
Автор

at 7:32 why is it expected that Prediction is NaN ? could you elaborate ?

eranotzap
Автор

The actual result is way different, you have an issue in you pandas variable storage min 17:00 valid['Predictions']=predictions, in the line before you linked in memory df and valid df.

alfonso
Автор

am getting an error whenever i run this
#Visualize the data
plt.figure(figsize=(12.5, 4.5))
plt.plot(AAPL['Adj Close Price'], label = ('AAPL'))
plt.title('Apple Adj. Close Price History')
plt.xlabel('Oct. 06 2014 - Oct. 27 2017')
plt.ylabel('Adj. Close Price USD ($)')
plt.legend(loc='upper left')
plt.show()

davidcmkubai
Автор

whether "training data" under linear regression is a one time exercise or we can re-train data again & again until we get the predicted values closer to actual values..???

vv
Автор

The idea of representing actual and predicted values is good
It really helped

pratiknarkhede
Автор

I have 2 questions:
1. I get a ValueError: Input contains NaN, infinity or a value too large for dtype('float32') relating to the code "tree = DecisionTreeRegressor().fit(x_train, y_train)" at 12:11... not sure how this came about since I've done all the rest the same. Do you have any ideas where this is from?
2. In previous videos you'd directly imported the data from yahoo finance, I'd tried this on a previous one and would usually run into an error somewhere down the line because it seems the titles aren't exactly aligned so that Date is in the 2nd row and the data starts in the 3rd. Is it possible to directly import the data and then correct that?
Thank you!

stephanp.
Автор

Sorry, how did you create the File on the second Code

sripuah
Автор

You musn't use train_test_split in time series predicting. Because train test split choose randomly for train & test dataset. You must use first n rows for train and other last rows for test.

fatihakca
Автор

I did not see that it is predicting 25 days in the future....correct me if

emilysm
Автор

I like the video. For beginners like me it gives you a structure of how to go about it. Thanks👍

mabokoseabi
Автор

bro I dont understand the part #Create the target data set (y) and convert it to numpy array and get all of the target values except the last 'x' days/rows, I see the last x rows is still there when I run it, and what is the differences betweeen target dataser and feature dataset?

hacktivistid
Автор

Why do you use DecisionTreeRegressor without any depth ? Isn't it overfitting.
I see a value of 1.0 if I do ```print(tree.score(X_train, y_train))```

usernamei
Автор

getting error while splitting data, " Found input variables with inconsistent numbers of samples: [25, 226]".
can you just say what can be done

prathika