Regularization Part 2: Lasso (L1) Regression

  Рет қаралды 596,226

StatQuest with Josh Starmer

StatQuest with Josh Starmer

Күн бұрын

Пікірлер: 660
@statquest
@statquest 2 жыл бұрын
If you want to see why Lasso can set parameters to 0 and Ridge can not, check out: kzbin.info/www/bejne/jp6VdJKdiaafbsU Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/
@hughsignoriello
@hughsignoriello 2 жыл бұрын
Love how you keep these videos introductory and don't go into the heavy math right away to confuse; Love the series!
@statquest
@statquest 2 жыл бұрын
Thank you!
@citypunter1413
@citypunter1413 6 жыл бұрын
One of the best explanation of Ridge and Lasso regression I have seen till date... Keep up the good work....Kudos !!!
@statquest
@statquest 6 жыл бұрын
Thanks! :)
@marisa4942
@marisa4942 2 жыл бұрын
I am eternally grateful to you and those videos!! Really saves me time in preparing for exams!!
@statquest
@statquest 2 жыл бұрын
Happy to help!
@admw3436
@admw3436 6 жыл бұрын
My teacher is 75 years old, explained us Lasso during one hour , without explaining it. But this is a war I can win :), thanks to your efforts.
@statquest
@statquest 6 жыл бұрын
I love it!!! Glad my video is helpful! :) p.s. I got the joke too. Nice! ;)
@ak-ot2wn
@ak-ot2wn 5 жыл бұрын
Why is this scenario many times the reality? Also, I check StatQuest's vids very often to really understand the things. Thanks @StatQuest
@JeanOfmArc
@JeanOfmArc 6 ай бұрын
(Possible) Fact: 78% of people who understand statistics and machine learning attribute their comprehension to StatQuest.
@statquest
@statquest 6 ай бұрын
bam! :)
@sethmichael6855
@sethmichael6855 2 ай бұрын
@@statquest Double Bam !!
@qiaomuzheng5800
@qiaomuzheng5800 2 жыл бұрын
Hi, I can't thank you enough for explaining the core concepts in such short amount of time. Your videos help a lot! My appreciations are beyond words.
@statquest
@statquest 2 жыл бұрын
Thank you!
@Phobos11
@Phobos11 6 жыл бұрын
Good video, but didn't really explain how LASSO gets to make a variable zero. What's the difference between squaring a term and using the absolute value for that?
@statquest
@statquest 6 жыл бұрын
Intuitively, the closer slope gets to zero, the square of that number becomes insignificant compared to the increase in the sum of the squared error. In other words, the smaller you slope, the square gets asymptotically close to 0 because it can't outweigh the increase in the sum of squared error. In contrast, the absolute value adds a fixed amount to the regularization penalty and can overcome the increase in the sum of squared error.
@statquest
@statquest 6 жыл бұрын
@@theethatanuraksoontorn2517 Maybe this discussion on stack-exchange will clear things up for you: stats.stackexchange.com/questions/151954/sparsity-in-lasso-and-advantage-over-ridge-statistical-learning
@programminginterviewprep1808
@programminginterviewprep1808 5 жыл бұрын
@@statquest Thanks for reading the comments and responding!
@statquest
@statquest 5 жыл бұрын
@@programminginterviewprep1808 I'm glad to help. :)
@Phobos11
@Phobos11 5 жыл бұрын
@@statquest I didn't reply before, but the answer really helped me a lot, with basic machine learning and now artificial neural networks, thank you very much for the videos and the replies :D
@anuradhadas8795
@anuradhadas8795 4 жыл бұрын
The difference between BAM??? and BAM!!! is hilarious!!
@statquest
@statquest 4 жыл бұрын
:)
@SaiSrikarDabbukottu
@SaiSrikarDabbukottu Жыл бұрын
​@@statquestCan you please explain how the irrelevant parameters "shrink"? How does Lasso go to zero when Ridge doesn't?
@statquest
@statquest Жыл бұрын
@@SaiSrikarDabbukottu I show how it all works in this video: kzbin.info/www/bejne/jp6VdJKdiaafbsU
@patrickwu5837
@patrickwu5837 4 жыл бұрын
That "Bam???" cracks me up. Thanks for your work!
@statquest
@statquest 4 жыл бұрын
:)
@Jan-oj2gn
@Jan-oj2gn 6 жыл бұрын
This channel is pure gold. This would have saved me hours of internet search... Keep up the good work!
@statquest
@statquest 6 жыл бұрын
Thank you! :)
@Jenna-iu2lx
@Jenna-iu2lx 2 жыл бұрын
I am so happy to easily understand these methods after only a few minutes (after spending so many hours studying without really understanding what it was about). Thank you so much, your videos are increadibly helpful! 💯☺
@statquest
@statquest 2 жыл бұрын
Great to hear!
@perrygogas
@perrygogas 6 жыл бұрын
Some video ideas to better explain the following topics: 1. Monte Carlo experiments 2. Bootstrapping 3. Kernel functions in ML 4. Why ML is black box
@statquest
@statquest 6 жыл бұрын
OK. I'll add those to the to-do list. The more people that ask for them, the more I'll priority they will get.
@perrygogas
@perrygogas 6 жыл бұрын
@@statquest That is great! keep up the great work!
@gauravms6681
@gauravms6681 5 жыл бұрын
@@statquest yes we need it please do plsssssssssssssssssssssssssssssssss plsssssssssssssssssssssssssssssssssssssssssssssss
@InfinitesimallyInfinite
@InfinitesimallyInfinite 5 жыл бұрын
Bootstrapping is explained well in Random Forest video.
@miguelsaravia8086
@miguelsaravia8086 5 жыл бұрын
Do it for us... thanks good stuff
@gonzaloferreirovolpi1237
@gonzaloferreirovolpi1237 5 жыл бұрын
Hi man, really LOVE your videos. Right now I'm studying Data Science and Machine Learning and more often than not your videos are the light at the end of the tunnel, sot thanks!
@chrisg0901
@chrisg0901 5 жыл бұрын
Don't think your Monty Python reference went unnoticed (Terrific and very helpful video, as always)
@statquest
@statquest 5 жыл бұрын
Thanks so much!!! :)
@ajha100
@ajha100 4 жыл бұрын
Oh it absolutely did. And it was much loved!
@takedananda
@takedananda 4 жыл бұрын
Came here because I didn't understand it at all when my professor lectured about LASSO in my university course... I have a much better understanding now thank you so much!
@statquest
@statquest 4 жыл бұрын
Awesome!! I'm glad the video was helpful. :)
@clementbourgade2487
@clementbourgade2487 4 жыл бұрын
NOBODY IS GOING TO TALK ABOUT THE EUROPEAN / AFRICAN SWALLOW REFERENCE ????are you all dummies or something ? It made my day. Plus, video on top, congratulation. BAMM !
@statquest
@statquest 4 жыл бұрын
bam!
@markparee99
@markparee99 5 жыл бұрын
Every time I think your video subject is going to be daunting, I find you explanation dispel that thought pretty quickly. Nice job!
@alexei.domorev
@alexei.domorev 2 жыл бұрын
Josh - as always your videos are brilliant in their simplicity! Please keep up your good work!
@statquest
@statquest 2 жыл бұрын
Thanks, will do!
@naomichin5347
@naomichin5347 2 жыл бұрын
I am eternally grateful to you. You've helped immensely with my last assessment in uni to finish my bachelors
@statquest
@statquest 2 жыл бұрын
Congratulations!!! I'm glad my videos were helpful! BAM! :)
@ファティン-z2v
@ファティン-z2v 3 ай бұрын
Very very well-explained video, easy way to gain knowledge on the matters that would otherwise looks complicated and takes long to understand if reading them from textbook, I never used ridge or lasso regression, just stumble upon the terms and got curious, but now I fell like I might have gotten a valuable data analysis knowledge that I potentially use in the future
@statquest
@statquest 3 ай бұрын
Glad it was helpful!
@praiseafrogtoday
@praiseafrogtoday 17 күн бұрын
this man is the heimlers history of statistics
@statquest
@statquest 16 күн бұрын
Thank you!
@terrencesatterfield9610
@terrencesatterfield9610 3 ай бұрын
Wow. This new understanding just slammed into me. Great job. Thank you.
@statquest
@statquest 3 ай бұрын
Glad it was helpful!
@sanyuktasuman4993
@sanyuktasuman4993 5 жыл бұрын
Your intro songs reminds me of Pheobe from the TV show "Friends", and the songs are amazing for starting the videos on a good note, cheers!
@statquest
@statquest 5 жыл бұрын
You should really check out the intro song for this StatQuest: kzbin.info/www/bejne/emHIl3t7f9iZftE
@atiqkhan7803
@atiqkhan7803 6 жыл бұрын
This is brilliant. Thanks for making it publicly available
@statquest
@statquest 6 жыл бұрын
You're welcome! :)
@jasonyimc
@jasonyimc 4 жыл бұрын
So easy to understand. And I like the double BAM!!!
@statquest
@statquest 4 жыл бұрын
Thanks!
@xendu-d9v
@xendu-d9v 2 жыл бұрын
Great people know subtle differences which is not visible to common eyes love you sir
@statquest
@statquest 2 жыл бұрын
Thanks!
@kitkitmessi
@kitkitmessi 2 жыл бұрын
Airspeed of swallow lol. These videos are really helping me a ton, very simply explained and entertaining as well!
@statquest
@statquest 2 жыл бұрын
Glad you like them!
@alecvan7143
@alecvan7143 5 жыл бұрын
The beginning songs are always amazing hahaha!!
@statquest
@statquest 5 жыл бұрын
Awesome! :)
@RussianSUPERHERO
@RussianSUPERHERO 2 жыл бұрын
I came for the quality content, fell in love with the songs and bam.
@statquest
@statquest 2 жыл бұрын
BAM! :)
@ajha100
@ajha100 4 жыл бұрын
I really appreciated the inclusion of swallow airspeed as a variable above and beyond the clear-cut explanation. Thanks Josh. ;-)
@statquest
@statquest 4 жыл бұрын
:)
@petrsomol
@petrsomol 4 жыл бұрын
Me too!
@praveerparmar8157
@praveerparmar8157 3 жыл бұрын
Just love the way you say 'BAM?'.....a feeling of hope mixed with optimism, anxiety and doubt 😅
@statquest
@statquest 3 жыл бұрын
:)
@joshuamcguire4832
@joshuamcguire4832 4 жыл бұрын
a man of his word...very clearly explained!
@statquest
@statquest 4 жыл бұрын
Thank you! :)
@ayush612
@ayush612 6 жыл бұрын
Yeahhhh!!! I was the first to express Gratitude to Josh for this awesome video!! Thanks Josh for posting this and man! your channel is growing.. last time, 4 months ago it was 12k. You have the better stats ;)
@statquest
@statquest 6 жыл бұрын
Hooray! Yes, the channel is growing and that is very exciting. It makes me want to work harder to make more videos as quickly as I can. :)
@akashdesarda5787
@akashdesarda5787 6 жыл бұрын
@@statquest please keep on going... You are our saviour
@ryanzhao3502
@ryanzhao3502 5 жыл бұрын
Thx very much. Clear explanation for these similar models. Great video I will conserve forever
@joaocasas4
@joaocasas4 Жыл бұрын
Me and my friend are studying. When the first BAM came, we fell for laught for about 5min. Then the DOUBLE BAM would cause a catrastofic laughter if we didn't stop it . I want you to be my professor please!
@statquest
@statquest Жыл бұрын
BAM! :)
@AnaVitoriaRodriguesLima
@AnaVitoriaRodriguesLima 4 жыл бұрын
Thanks for posting, my new favourite youtube channel absolutely !!!!
@statquest
@statquest 4 жыл бұрын
Wow, thanks!
@TeXtersWS
@TeXtersWS 5 жыл бұрын
Explained in a very simple yet very effective way! Thank you for your contribution Sir
@statquest
@statquest 5 жыл бұрын
Hooray! I'm glad you like my video. :)
@luispulgar7515
@luispulgar7515 5 жыл бұрын
Bam! I appreciate the pace of the videos. Thanks for doing this.
@statquest
@statquest 5 жыл бұрын
Thanks! :)
@add6911
@add6911 Жыл бұрын
Excelent video Josh! Amazing way to explain Statistics Thank you so much! Regards from Querétaro, México
@statquest
@statquest Жыл бұрын
Muchas gracias! :)
@tymothylim6550
@tymothylim6550 3 жыл бұрын
Thank you, Josh, for this exciting and educational video! It was really insightful to learn both the superficial difference (i.e. how the coefficients of the predictors are penalized) and the significant difference in terms of application (i.e. some useless predictors may be excluded through Lasso regression)!
@statquest
@statquest 3 жыл бұрын
Double BAM! :)
@hanadiam8910
@hanadiam8910 2 жыл бұрын
Million BAM for this channel 🎉🎉🎉
@statquest
@statquest 2 жыл бұрын
Thank you!
@hareshsuppiah9899
@hareshsuppiah9899 4 жыл бұрын
Statquest is like Marshall Eriksen from HIMYM teaching us stats. BAM? Awesome work Josh.
@statquest
@statquest 4 жыл бұрын
Thanks!
@hsinchen4403
@hsinchen4403 4 жыл бұрын
Thank you so much for the video ! I have watched several your videos and I prefer to watch your video first then see the real math formula. When I did that, the formula became so easier and understandable! For instance, I don't even know what does 'norm' is, but after watching your video then it would be very easy to understand!
@statquest
@statquest 4 жыл бұрын
Awesome! I'm glad the videos are helpful. :)
@mrknarf4438
@mrknarf4438 4 жыл бұрын
Great video, clear explanation, loved the Swallows reference! Keep it up! :)
@statquest
@statquest 4 жыл бұрын
Awesome, thank you!
@gregnelson8148
@gregnelson8148 5 жыл бұрын
You have a gift for teaching! Excellent videos!
@statquest
@statquest 5 жыл бұрын
Thanks! :)
@luisakrawczyk8319
@luisakrawczyk8319 5 жыл бұрын
How do Ridge or Lasso know which variables are useless? Will they not also shrink the parameter of important variables ?
@suriahselvam9066
@suriahselvam9066 5 жыл бұрын
I am also looking for the answer to this. I'm just using my intuition here, but here's what I think. The least important variables have terrible predictive value so the residuals along these dimensions are the highest. If we create a penalty for introducing these variables (especially with a large lambda that outweighs/similar in magnitude to the size of these residuals squared), decrease in coefficient of these "bad predictors" will cause comparatively smaller increase in residuals compared to the decrease in penalty due to the randomness of these predictors. In contrast, the penalty for "good predictors" (which are less random) will cause significant change in residuals as we decrease its coefficients. This would probably mean that these coefficients would have to undergo smaller change to account for the larger increase in residuals. This is why the minimisation will reduce the coefficients of "bad predictors" faster than "good predictors. I take this case would be especially true when cross-validating.
@orilong
@orilong 5 жыл бұрын
if you draw the curves of y=x and y=x^2, you will find the gradient will vanish for y=x^2 near origin point, hence very hard to be decreased to zero if using optimizing approach like SGD.
@siriuss_7
@siriuss_7 3 жыл бұрын
Your videos make it so easy to understand. Thank you!
@statquest
@statquest 3 жыл бұрын
Thank you! :)
@flyingdutchmanSimon
@flyingdutchmanSimon 4 жыл бұрын
Seriously the best videos ever!!
@statquest
@statquest 4 жыл бұрын
Thanks!
@CDALearningHub
@CDALearningHub 4 жыл бұрын
Hi Josh, Thanks for clear explanation on regularization techniques. very exciting. God bless for efforts.
@statquest
@statquest 4 жыл бұрын
Glad you enjoyed it!
@corneliusschramm5791
@corneliusschramm5791 6 жыл бұрын
Dude you are an absolute lifesaver! keep it up!!!
@statquest
@statquest 6 жыл бұрын
Hooray! I'm glad I could help. :)
@rishabhkumar-qs3jb
@rishabhkumar-qs3jb 3 жыл бұрын
Amazing video, explanation is fantastic. I like the song along with the concept :)
@statquest
@statquest 3 жыл бұрын
Bam! :)
@PythonArms
@PythonArms Жыл бұрын
Harvard should hire you. Your videos never fail me! Thank you for such great content!
@statquest
@statquest Жыл бұрын
Thank you very much!!!
@davidmantilla1899
@davidmantilla1899 2 жыл бұрын
Best youtube channel
@statquest
@statquest 2 жыл бұрын
Thank you! :)
@abdulazizalhaidari7665
@abdulazizalhaidari7665 7 ай бұрын
Great work, Thank you Josh, I'm trying to connect ideas from different perspectives/angles, Does the lambda here somehow related to Lagrange multiplier ?
@statquest
@statquest 7 ай бұрын
I'm not sure.
@gulmiraleman4487
@gulmiraleman4487 2 жыл бұрын
Teşekkürler.
@statquest
@statquest 2 жыл бұрын
Thank you! TRIPLE BAM! :)
@apekshaagrawal6696
@apekshaagrawal6696 4 жыл бұрын
Thanks for the Video. They make difficult concepts seem really easy..
@statquest
@statquest 4 жыл бұрын
Thank you! :)
@apekshaagrawal6696
@apekshaagrawal6696 4 жыл бұрын
@@statquest Can u make a similar video for LSTM?
@TheBaam100
@TheBaam100 5 жыл бұрын
Thank you so much for making these videos! Had to hold a presentation about LASSO in university.
@statquest
@statquest 5 жыл бұрын
I hope the presentation went well! :)
@TheBaam100
@TheBaam100 5 жыл бұрын
@@statquest Thx. It did :)
@rezaroshanpour971
@rezaroshanpour971 Жыл бұрын
Great....please continue to learn other models...thank you so much.
@statquest
@statquest Жыл бұрын
Thanks!
@stefanomauceri
@stefanomauceri 6 жыл бұрын
I prefer the intro where is firmly claimed that StatQuest is bad to the bone. And yes I think this is fundamental.
@statquest
@statquest 6 жыл бұрын
That’s one of my favorite intros too! :)
@statquest
@statquest 6 жыл бұрын
But I think my all time favorite is the one for LDA.
@stefanomauceri
@stefanomauceri 6 жыл бұрын
Yes I agree! Together these two could be the StatQuest manifesto summarising what people think about stats!
@statquest
@statquest 6 жыл бұрын
So true!
@whispers191
@whispers191 2 жыл бұрын
Thank you once again Josh!
@statquest
@statquest 2 жыл бұрын
bam!
@cloud-tutorials
@cloud-tutorials 5 жыл бұрын
One more use case of Ridge/Lasso regression is 1) When data points are less 2) High Multicollinearity between variables
@kyoosik
@kyoosik 6 жыл бұрын
The other day, I had homework to write about Lasso and I struggled.. wish I had seen this video a few days earlier.. Thank you as always!
@privatelabel3839
@privatelabel3839 4 жыл бұрын
How do you know if a model is overfitting or not? I remember we could use Cross-Validation and compare the training error to the test error. But does it mean it's overfitting if the test error is higher than training?
@statquest
@statquest 4 жыл бұрын
Yes, however, if the test error is only a little worse than training error, it's not a big deal.
@privatelabel3839
@privatelabel3839 4 жыл бұрын
​@@statquest Great. thanks!
@abdullahmoiz8151
@abdullahmoiz8151 6 жыл бұрын
Brilliant explanation didnt need to check out any other video
@statquest
@statquest 6 жыл бұрын
Thank you!
@abelgeorge4953
@abelgeorge4953 11 ай бұрын
Thank you for clarifying that the Swallow can be African or European
@statquest
@statquest 11 ай бұрын
bam! :)
@emmanueluche3262
@emmanueluche3262 2 жыл бұрын
Wow! so easy to understand this! Thanks very much!
@statquest
@statquest 2 жыл бұрын
Thanks!
@Endocrin-PatientCom
@Endocrin-PatientCom 5 жыл бұрын
Incredible great explanations of regularization methods, thanks a lot.
@statquest
@statquest 5 жыл бұрын
Thanks! :)
@adwindtf
@adwindtf 4 жыл бұрын
love your videos.... extremely helpful and cristal clear explained.... but your songs..... let's say you have a very promising career as a statistician... no question
@statquest
@statquest 4 жыл бұрын
;)
@arthurus8374
@arthurus8374 3 жыл бұрын
so incredible, so well explained
@statquest
@statquest 3 жыл бұрын
Thanks!
@RenoyZachariah
@RenoyZachariah 2 жыл бұрын
Amazing explanation. Loved the Monty Python reference :D
@statquest
@statquest 2 жыл бұрын
:)
@longkhuong8382
@longkhuong8382 6 жыл бұрын
Hooray!!!! excellent video as always Thank you!
@statquest
@statquest 6 жыл бұрын
Hooray, indeed!!!! Glad you like this one! :)
@rakeshk6799
@rakeshk6799 2 жыл бұрын
Is there a more detailed explanation as to how some feature weights become zero in the case of Lasso, and why that cannot happen in Ridge? Thanks.
@statquest
@statquest 2 жыл бұрын
Yes, see: kzbin.info/www/bejne/jp6VdJKdiaafbsU
@rakeshk6799
@rakeshk6799 2 жыл бұрын
@@statquest Thanks! I watched the video, but I am still not sure why there is a kink in the case of Lasso. What exactly creates that kink?
@statquest
@statquest 2 жыл бұрын
@@rakeshk6799 The absolute value function.
@lizhihuang3312
@lizhihuang3312 7 ай бұрын
6:29 why these parameters shrink a lot but never reach zero? why it shrink on different propotion? is t hat because of the thing which multiply with them
@statquest
@statquest 7 ай бұрын
Ah! I see you already found the video that shows why these don't go to zero.
@zebralemon
@zebralemon Жыл бұрын
I enjoy the content and your jam so much! '~Stat Quest~~'
@statquest
@statquest Жыл бұрын
Thanks!
@raghavgaur8901
@raghavgaur8901 5 жыл бұрын
Hello Josh,Can you tell at time 3:53 we are using two lines in one graph so can you tell me how does it work because I wasn't able to understand it.
@statquest
@statquest 5 жыл бұрын
All of my regularization videos assume that you understand linear models. The good news is that I have a bunch of videos on this topic. Check out linear models parts 0, 1, 2 and 3 videos: statquest.org/video-index/
@mahajanpower
@mahajanpower 5 жыл бұрын
Hi Josh! I am a big fan of your videos and it is clearly the best way to learn machine learning. I would like to ask you if you will be uploading videos relating to deep learning and NLP as well. If so, that will be awesome. BAM!!!
@statquest
@statquest 5 жыл бұрын
Right now I'm finishing up Support Vector Machines (one more video), then I'll do a series of videos on XGBoost and after that I'll do neural networks and deep learning.
@mahajanpower
@mahajanpower 5 жыл бұрын
StatQuest with Josh Starmer Thanks Josh for the updates. I’ll send you request at Linkedin.
@ainiaini4426
@ainiaini4426 2 жыл бұрын
Hahaha.. That moment you said BAM??? I laughed out loud 🤣🤣🤣
@statquest
@statquest 2 жыл бұрын
:)
@胡振鹏-w3f
@胡振鹏-w3f 6 жыл бұрын
I have one thing that do not understand, if the sample size is small and has to use lasso or regid regression, and determine "lamda" using a cross validation, why not use more sample in the training data set and reduce the size of test set?
@statquest
@statquest 6 жыл бұрын
Usually the sample size is only small relative to the number of parameters you are estimating. For example, you might have 25,000 parameters to estimate, but only 5,000 samples. In this case, you don’t have enough samples to estimate the parameters without using ridge, lasso or elastic-net, so cross validation for lambda is the only way to solve the problem. Does that make sense?
@胡振鹏-w3f
@胡振鹏-w3f 6 жыл бұрын
@@statquest I see! then that is much clear to me! Thank you! Like the video a LOT!
@anujsaboo7081
@anujsaboo7081 5 жыл бұрын
Great video, one doubt. Since you say Lasso Regression can exclude useless variables from the model, can it assist for variable(or feature) selection which I currently do in Linear Regression using the p value?
@statquest
@statquest 5 жыл бұрын
Yes! One of the things that Lasso Regression does well is help identify the optimal subset of variables that you should use in your model.
@ninakumagai22
@ninakumagai22 5 жыл бұрын
My favourite youtuber!
@statquest
@statquest 5 жыл бұрын
Thank you! :)
@johnholbrook1447
@johnholbrook1447 6 жыл бұрын
Fantastic videos - very well explained!
@statquest
@statquest 6 жыл бұрын
Thank you! :)
@pelumiobasa3104
@pelumiobasa3104 5 жыл бұрын
this is awesome thank you so much for this u explained it so well . I will recommend this video to every one I know who is interested . I also watched your lasso video and it was just as good thank you
@statquest
@statquest 5 жыл бұрын
Thank you very much! :)
@tiborcamargo5732
@tiborcamargo5732 6 жыл бұрын
That Monty Python reference though... good video btw :)
@statquest
@statquest 6 жыл бұрын
Ha! I'm glad you like the video. ;)
@lucianotarsia9985
@lucianotarsia9985 3 жыл бұрын
Great video! The topic is really well explained
@statquest
@statquest 3 жыл бұрын
Thank you!
@khanhtruong3254
@khanhtruong3254 5 жыл бұрын
Hi. Your videos are so helpful. I really appreciate you spend time doing them. I have one question related to this video: Is the result of Lasso Regression sensitive to the unit of variables? For example in the model: size of mice = B0 + B1*weight + B2*High Fat Diet + B3*Sign + B4*AirSpeed + epsilon Suppose the original unit of weight in the data is gram. If we divide the weight by 1,000 to get unit in kilogram, is the Lasso Regression different? As I understand, the least square estimated B1-kilogram should be 1,000 times higher than the B1-gram. Therefore, B1-kilogram is more likely to be vanished in Lasso, isn't?
@yilinxie2457
@yilinxie2457 5 жыл бұрын
Thanks! I finally understand how they shrink parameters!
@amnont8724
@amnont8724 Жыл бұрын
Hey Josh, how come that when we increase the lambda - "penalty thing", the useless variables in the complicated example you gave went to 0 in lasso regression, while they didn't in ridge regression? Because the difference between the 2 regressions seems to be only the absolute value vs square (of any of the variables in the complicated equation).
@statquest
@statquest Жыл бұрын
I'll illustrate the differences between lasso and ridge regression in this video: kzbin.info/www/bejne/jp6VdJKdiaafbsU
@Kabletor
@Kabletor 6 жыл бұрын
Great videos...thanks for making them. It is clear how squared values differ from absolute values...BUT why, if I apply the same 'lambda' value and the same regression to all 4 parameters (slope, diet difference, astrological offset and airspeed scalar) they should behave differently and only the silly ones disappear (astrological offset and airspeed scalar) in case I use lasso regression ? I hope my question is clear... THANKS !!!!
@statquest
@statquest 6 жыл бұрын
Are you asking why the lasso regression can make silly parameters disappear and ridge regression can only make silly parameters get smaller?
@Kabletor
@Kabletor 6 жыл бұрын
@@statquest Thanks for the answer...actually no. I think I have that clear. What I'm not able to figure it out is why (regardless of the approach - ridge and lasso) you say that the 'good' parameters 'slope' and 'diet difference' will behave differently than the other two silly ones. For example, in case of the lasso you say that while good parameters will shrink a little bit the silly ones will go all the way to 0....I don't understand why since you are applying the same 'lambda' and absolute value for all 4 parameters... (sorry, probably I've just missed some details...)
@statquest
@statquest 6 жыл бұрын
@@Kabletor That's a good question. Let's go through an example. Imagine we were fitting a regression for weight with two variables: size and astrological sign. Now, just to keep things simple, let's imagine lambda is set to 1. This means that the goal of lasso regression is to minimize the sum of the squared residuals plus the absolute value of the parameter for weight plus the absolute value of the the parameter for astrological sign. Now, let's initialize both parameters to 10. With both parameters starting at 10, we can sum the squared residuals and add 10 for the size parameter and add 10 for the astrological sign parameter. Now we can shrink the parameter for size a little bit, say to 8, calculate the the new sum of squared residuals and add 8 and 10 to that. Is that new total less than the first total we calculated. Since size and weight are correlated, let's just assume that it is not. In this case, we reset the size parameter to 10 and shrink the astrological sign to 8. Now we calculate the new sum of squared residuals plus 10 and 8. Is that new total less than the first total we calculated? Given that astrological sign is not correlated with weight, it probably is. So we leave the parameter for astrological sign at 8. Now we try shrinking the size parameter and again to see if that helps. If not, we reset it to 10. Then we shrink the astrological sign some more and see of that helps. If so, we go with the new value. This process repeats until the parameter for astrological sign is minimized given the constraint that we want to minimize the squared residuals *and* the sum of the parameter values. In this way, we can have one value for lambda, but different amounts of shrinkage for each parameter. Does that make sense?
@Kabletor
@Kabletor 6 жыл бұрын
@@statquest Wow Josh...not only you are able to create amazing video lessons...you also have extremely valuable answers that clarify all doubts. Your answer makes absolute sense and clarified completely my question. Thank you so much for your time and amazing contributions !
@statquest
@statquest 6 жыл бұрын
@@Kabletor Hooray!!! I'm glad we could clear that up. :)
@pratiknabriya5506
@pratiknabriya5506 4 жыл бұрын
A StatQuest a day, keeps Stat fear away!
@statquest
@statquest 4 жыл бұрын
I love it! :)
@DonnyDonowitz22
@DonnyDonowitz22 5 жыл бұрын
The best explanation ever.
@chadmadding
@chadmadding 6 жыл бұрын
Always amazing videos.
@statquest
@statquest 6 жыл бұрын
Thank you!
@dominicdill
@dominicdill Жыл бұрын
@2:30 you state that the main idea is by starting with a slightly worse fit, ridge regression provided better long term predictions. But isn't this only true when the trained linear model starts off with a larger slope than it should? For instance, if the initial two data points for the linear model without ridge regression were the bottom two points, wouldn't ridge regression result in a worse model? How do you know when your slope is higher than it should be?
@statquest
@statquest Жыл бұрын
Remember, the goal of lambda is not to give us the optimal fit, but to prevent overfitting. If a positive value for lambda does not improve the situation, then the optimal value for lambda (discovered via cross validation) will be 0, and the line will fit no worse than the Ordinary Least Squares Line.
@SieolaPeter
@SieolaPeter Жыл бұрын
Finally, I found 'The One'!
@statquest
@statquest Жыл бұрын
:)
@hUiLi8905
@hUiLi8905 4 жыл бұрын
I have seen some articles mentioning that Ridge Regression is better in handling multicollinearity between variables as compared to Lasso. But i am not sure of the reason why. Since the difference between Lasso and Ridge is just the way it penalized the coefficients.
@Viper36P
@Viper36P 4 жыл бұрын
Hello! As I understand both concepts, the regression penalty will (always) lead to a reduced slope (or whatever parameter) in order to match the testing data with lower variance. In the previous video on ridge regression it was said that lambda can take values from 0 to +\infty. Now, imagine the training data initially leads to a fit with small parameters (e. g. slope), that underestimates the suitable parameters regarding long term observations. In this case the penalty and therefore further reduction of the parameters result in higher variance instead of lower, doesn`t it? Thanks and Greetings!
@statquest
@statquest 4 жыл бұрын
If regularization does not improve the situation over the original fit, then the regularization parameter will be set to 0 and it will have no effect.
@Viper36P
@Viper36P 4 жыл бұрын
@@statquest and how, technically, lambda is determined from the testing data?
@statquest
@statquest 4 жыл бұрын
@@Viper36P You test a bunch of values, including 0, with Cross Validation: kzbin.info/www/bejne/nITcpa19rNx1jNk
@pondie5381
@pondie5381 3 жыл бұрын
exactly what I am looking for in the reviews!
@ZinzinsIA
@ZinzinsIA 2 жыл бұрын
So clear and interesting, many thanks ! But what is the mathematical reason for the L1 norm producing parameters = 0 on the dummy variables while L2 norm can only go to zero asymptotically ?
@statquest
@statquest 2 жыл бұрын
To get a better understanding of the differences between lasso and ridge regression, see: kzbin.info/www/bejne/jp6VdJKdiaafbsU
@ZinzinsIA
@ZinzinsIA 2 жыл бұрын
@@statquest Ok thanks a lot for your answer and all the amazing work !
@조동민-f6o
@조동민-f6o 6 жыл бұрын
I have a question! Does astrological sign and airspeed of swallow mean irreducible error? or Do they have any other meanings?
@statquest
@statquest 6 жыл бұрын
I believe that irreducible error refers to errors in measurement - for example: I have a scale that measures in pounds - so when I weight myself, it tells me how much I weigh in pounds. However, that's not a very precise measurement - and this lack of precision in everything I weigh using this scale, results in errors that won't go away, no matter how many times I weigh myself or anything else. Does this make sense?
@조동민-f6o
@조동민-f6o 6 жыл бұрын
Oh! i understood it well. Your lecture is very helpful to me. So, i'm planning to advertise your lecture to all koreans ~ hahaha! Thank you anyways!
@statquest
@statquest 6 жыл бұрын
@@조동민-f6o Awesome! If enough people in Korea watch these videos, maybe one day I can come to Korea and present a StatQuest in person. That would be fun.
@sophie-ev1mr
@sophie-ev1mr 5 жыл бұрын
Thank you so much for these videos you are a literal godsend. You should do a video on weighted least squares!!
@kd1415
@kd1415 3 жыл бұрын
love the work, i remember reading books about linear regresion, when they spent like 5 pages for these 2 topics but i still have no clue what they really do =))
@statquest
@statquest 3 жыл бұрын
Glad it was helpful!
@kd1415
@kd1415 3 жыл бұрын
Love the fact that you reply to every single comment here in YT haha
Regularization Part 3: Elastic Net Regression
5:19
StatQuest with Josh Starmer
Рет қаралды 212 М.
Regularization Part 1: Ridge (L2) Regression
20:27
StatQuest with Josh Starmer
Рет қаралды 1,1 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 15 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 17 МЛН
StatQuest: Principal Component Analysis (PCA), Step-by-Step
21:58
StatQuest with Josh Starmer
Рет қаралды 3 МЛН
Lasso Regression for Beginners | By Dr. Ry @Stemplicity
4:02
Prof. Ryan Ahmed
Рет қаралды 40 М.
Ridge vs Lasso Regression, Visualized!!!
9:06
StatQuest with Josh Starmer
Рет қаралды 266 М.
Linear Regression, Clearly Explained!!!
27:27
StatQuest with Josh Starmer
Рет қаралды 1,4 МЛН
Machine Learning Fundamentals: Bias and Variance
6:36
StatQuest with Josh Starmer
Рет қаралды 1,3 МЛН
Bayesian Linear Regression : Data Science Concepts
16:28
ritvikmath
Рет қаралды 86 М.
Pearson's Correlation, Clearly Explained!!!
19:13
StatQuest with Josh Starmer
Рет қаралды 400 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН