No video

Linear Regression Model Techniques with Python, NumPy, pandas and Seaborn

  Рет қаралды 59,935

Matt Macarty

Matt Macarty

Күн бұрын

#Python #Regression #NumPy
alphabench.com...
✅ Please SUBSCRIBE:
www.youtube.co...
Try my Hands-on Python for Finance course on Udemy: www.udemy.com/...
✅ Link to Github repo:
github.com/mjm...
*For Educational purposes only. Should not be construed as investment advice.
✅ Watch my other Stock and Data Analsis videos:
• Algorithmic Trading
• Python for Data Analysis
✅ Pandas videos:
• Python pandas

Пікірлер: 50
@brentnunn2595
@brentnunn2595 2 жыл бұрын
Thank you Matt. You explain things so well. I've watched several of your videos and intend to watch more.
@MattMacarty
@MattMacarty 2 жыл бұрын
Thanks very much. Glad it's helping.
@PaoloCondo
@PaoloCondo Жыл бұрын
Thank you for your work and the video!
@MattMacarty
@MattMacarty Жыл бұрын
Thanks. Glad it helped
@get_busy_living
@get_busy_living 2 жыл бұрын
Thank you for this. I was looking for a way to code a trend line. With many traders it becomes subjective. This makes it more precise.
@MattMacarty
@MattMacarty 2 жыл бұрын
Thanks. Glad it helped
@aimenslamat1264
@aimenslamat1264 Жыл бұрын
@@MattMacarty hi bro thank u so much for the video its help a lot , but could u tell me why we use the np log diff ?
@MattMacarty
@MattMacarty Жыл бұрын
Great. Glad it helped.
@MattMacarty
@MattMacarty Жыл бұрын
Glad it helped. Yes you can copy tables. see this video: kzbin.info/www/bejne/bGm7fp-FbsuWn6M
@MattMacarty
@MattMacarty Жыл бұрын
@@aimenslamat1264 The log change is referred to as the instantaneous rate of return and is commonly used to price securities, particularly derivatives
@alvarezhenao
@alvarezhenao 10 ай бұрын
Hello Matt, first of all, thank you for your work. I have tried to reproduce this exercise and when executing the line 'data = pdr.get_data_yahoo(stocks, start)' I get the following error message: 'TypeError: string indices must be integers, not 'str'. I have tried to solve it in different ways, but nothing, it always gives me that message. I downloaded your code in case there was something written incorrectly, and it gives me the same error. Any suggestions?
@MattMacarty
@MattMacarty 10 ай бұрын
Thanks. The problem is the pandas_datareader has not kept up with changes to the yahoo finance API. The workaround is to install yfinance (pip install yfinance). Then it would be yfinance.download(stocks, start)
@iamekid8299
@iamekid8299 2 жыл бұрын
Hi there, firstly great video! How would it be possible to add another variable to the trend line? So essentially it would be multiple linear regression
@MattMacarty
@MattMacarty 2 жыл бұрын
Thanks. Generally two explanatory variables would be graphed as a plane.
@tialynn1111
@tialynn1111 Жыл бұрын
Thank you! Is this also good for predicting a range? Say 30 periods out?
@MattMacarty
@MattMacarty Жыл бұрын
Glad it helped. It's tough to predict out that far, but yes it might give you something better than just guessing.
@tialynn1111
@tialynn1111 Жыл бұрын
@@MattMacarty thank you Matt!
@amanrai5285
@amanrai5285 2 жыл бұрын
Thank you sir for explaing the code in the detail
@amanrai5285
@amanrai5285 2 жыл бұрын
explaining*
@MattMacarty
@MattMacarty 2 жыл бұрын
Glad it helped
@satonaka123
@satonaka123 2 жыл бұрын
Thank you Matt. Would like to know what is different btw "np.log().diff()" and "pct_change().cumsum()", I've tried those two syntax then got a different result. Could you pls solve this question? Thanks again Matt.
@MattMacarty
@MattMacarty 2 жыл бұрын
pct_change is E/B - 1, np.log is LN(E/B). LN is a continuously compounding rate.
@eliotharreau7627
@eliotharreau7627 Жыл бұрын
Very Nice, Hello Matt, in the section "trend as a technical indicateur", how to put the value of the trend line in a dataframe to detect later when it cross the curve ? Thank you. 👍👍
@MattMacarty
@MattMacarty Жыл бұрын
You need the slope and intercept coefficient and then you can create a column with the trend line
@eliotharreau7627
@eliotharreau7627 Жыл бұрын
@@MattMacarty Yess my friend it s exactly what i want, maybe if you have a small example ? Thnx.
@Joe-xo2yd
@Joe-xo2yd 2 жыл бұрын
Matt, if I wanted to take the first derivative of the linear regression function, how could I execute that? is there a certain package?
@MattMacarty
@MattMacarty 2 жыл бұрын
Sure, you can use NumPy, SciPy, scikit-learn. Probably a number of others but that's what comes to mind.
@nicholasrackard-hilt1619
@nicholasrackard-hilt1619 2 жыл бұрын
Thank you for the video!! How would I add another more trend lines to subset set specific times or dates? I am trying to plot my X and Y for 9 am 10am 12pm and have multiple trend lines. Hope that makes sense, thank you in advance!
@MattMacarty
@MattMacarty 2 жыл бұрын
You mean for different time periods, say an hour for each? You should be able to subset the data and then run a regression on each subset.
@Shinykip
@Shinykip 3 жыл бұрын
Could you possibly provide a link to the data set you actually used in this tutorial? I would like to follow it locally on my PC as I go through this. Thank you.
@MattMacarty
@MattMacarty 3 жыл бұрын
Hi the data was downloaded from Yahoo finance. Here is a link to the notebook: github.com/mjmacarty/alphavantage
@philtoa334
@philtoa334 2 жыл бұрын
Very good Thank you.
@MattMacarty
@MattMacarty 2 жыл бұрын
Glad it helped
@tonyhathuc
@tonyhathuc 3 жыл бұрын
Hi I am running into this error: No data fetched using 'YahooDailyReader'
@MattMacarty
@MattMacarty 3 жыл бұрын
Can you send me the line of code that caused the error?
@anthonychung2907
@anthonychung2907 Жыл бұрын
what to do if the x-axis is time series ?
@MattMacarty
@MattMacarty Жыл бұрын
Probably the easiest thing to do is make time the independent variable.
@jamesnelligan660
@jamesnelligan660 2 жыл бұрын
i get error: "ModuleNotFoundError: No module named 'pandas_datareader'"
@MattMacarty
@MattMacarty 2 жыл бұрын
Hi this means you need to install it. Run !pip install pandas-datareader in a code cell in your notebook
@mamunmd.abdullahall5122
@mamunmd.abdullahall5122 Жыл бұрын
import pandas_datareader as pdr is not working , what shoul di do
@MattMacarty
@MattMacarty Жыл бұрын
This probably means it is not installed. From the command line run pip install pandas-datareader
@marcus.guitarist
@marcus.guitarist Жыл бұрын
@@MattMacarty looks like Yahoo might have changed something
@danieleliahushapiro4280
@danieleliahushapiro4280 3 жыл бұрын
Correlation != Causality !!!
@MattMacarty
@MattMacarty 3 жыл бұрын
Exactly
@fuhat1040
@fuhat1040 2 жыл бұрын
i got two points
@MattMacarty
@MattMacarty 2 жыл бұрын
Hi. You can download the notebook I used here: alphabench.com/data/python-linear-regression.html
@fuhat1040
@fuhat1040 2 жыл бұрын
@@MattMacarty yeah i still got two points for spy and Google might be due to a crash
@fuhat1040
@fuhat1040 2 жыл бұрын
do you want to look at my notebook when I finish it.
@fuhat1040
@fuhat1040 2 жыл бұрын
changed the symbols still got two points using goog
Basic Usage of NumPy Financial for Loan Payments and Amortization
8:50
Linear Regression in Python - Full Project for Beginners
50:52
Alejandro AO - Software & Ai
Рет қаралды 18 М.
Before VS during the CONCERT 🔥 "Aliby" | Andra Gogan
00:13
Andra Gogan
Рет қаралды 10 МЛН
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 6 МЛН
白天使选错惹黑天使生气。#天使 #小丑女
00:31
天使夫妇
Рет қаралды 15 МЛН
Кадр сыртындағы қызықтар | Келінжан
00:16
Learn Statistical Regression in 40 mins! My best video ever. Legit.
40:25
How to make a correlation matrix in python
8:46
Karina Adcock
Рет қаралды 2,8 М.
Linear Regression From Scratch in Python (Mathematical)
24:38
NeuralNine
Рет қаралды 168 М.
Multiple regression: how to select variables for your model
10:46
R Programming 101
Рет қаралды 8 М.
Linear Regression, Clearly Explained!!!
27:27
StatQuest with Josh Starmer
Рет қаралды 241 М.
Logistic Regression Project: Cancer Prediction with Python
44:21
Alejandro AO - Software & Ai
Рет қаралды 7 М.
Polynomial Regression in Python
20:18
NeuralNine
Рет қаралды 45 М.
All Learning Algorithms Explained in 14 Minutes
14:10
CinemaGuess
Рет қаралды 226 М.
Before VS during the CONCERT 🔥 "Aliby" | Andra Gogan
00:13
Andra Gogan
Рет қаралды 10 МЛН