Regularization Part 2: Lasso (L1) Regression

Поділитися
Вставка
  • Опубліковано 22 лис 2024

КОМЕНТАРІ •

  • @statquest
    @statquest  2 роки тому +13

    If you want to see why Lasso can set parameters to 0 and Ridge can not, check out: ua-cam.com/video/Xm2C_gTAl8c/v-deo.html
    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 роки тому +16

    Love how you keep these videos introductory and don't go into the heavy math right away to confuse;
    Love the series!

  • @marisa4942
    @marisa4942 2 роки тому +38

    I am eternally grateful to you and those videos!! Really saves me time in preparing for exams!!

  • @citypunter1413
    @citypunter1413 6 років тому +69

    One of the best explanation of Ridge and Lasso regression I have seen till date... Keep up the good work....Kudos !!!

  • @admw3436
    @admw3436 6 років тому +18

    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 років тому +3

      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 5 місяців тому +22

    (Possible) Fact: 78% of people who understand statistics and machine learning attribute their comprehension to StatQuest.

  • @Jenna-iu2lx
    @Jenna-iu2lx 2 роки тому +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! 💯☺

  • @qiaomuzheng5800
    @qiaomuzheng5800 2 роки тому +11

    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.

  • @Phobos11
    @Phobos11 6 років тому +269

    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 років тому +143

      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  5 років тому +37

      @@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 років тому +25

      @@statquest Thanks for reading the comments and responding!

    • @statquest
      @statquest  5 років тому +29

      @@programminginterviewprep1808 I'm glad to help. :)

    • @Phobos11
      @Phobos11 5 років тому +9

      @@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

  • @patrickwu5837
    @patrickwu5837 4 роки тому +26

    That "Bam???" cracks me up. Thanks for your work!

  • @ファティン-z2v
    @ファティン-z2v 2 місяці тому +1

    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  2 місяці тому

      Glad it was helpful!

  • @gonzaloferreirovolpi1237
    @gonzaloferreirovolpi1237 5 років тому +3

    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!

  • @takedananda
    @takedananda 4 роки тому +1

    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. :)

  • @perrygogas
    @perrygogas 5 років тому +174

    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  5 років тому +90

      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 5 років тому +5

      @@statquest That is great! keep up the great work!

    • @gauravms6681
      @gauravms6681 5 років тому +3

      @@statquest yes we need it please do plsssssssssssssssssssssssssssssssss
      plsssssssssssssssssssssssssssssssssssssssssssssss

    • @InfinitesimallyInfinite
      @InfinitesimallyInfinite 5 років тому +10

      Bootstrapping is explained well in Random Forest video.

    • @miguelsaravia8086
      @miguelsaravia8086 5 років тому +1

      Do it for us... thanks good stuff

  • @anuradhadas8795
    @anuradhadas8795 4 роки тому +37

    The difference between BAM??? and BAM!!! is hilarious!!

    • @statquest
      @statquest  4 роки тому +1

      :)

    • @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: ua-cam.com/video/Xm2C_gTAl8c/v-deo.html

  • @naomichin5347
    @naomichin5347 2 роки тому +1

    I am eternally grateful to you. You've helped immensely with my last assessment in uni to finish my bachelors

    • @statquest
      @statquest  2 роки тому +1

      Congratulations!!! I'm glad my videos were helpful! BAM! :)

  • @Jan-oj2gn
    @Jan-oj2gn 6 років тому +2

    This channel is pure gold. This would have saved me hours of internet search... Keep up the good work!

  • @clementbourgade2487
    @clementbourgade2487 4 роки тому +2

    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 !

  • @xendu-d9v
    @xendu-d9v 2 роки тому +1

    Great people know subtle differences which is not visible to common eyes
    love you sir

  • @chrisg0901
    @chrisg0901 5 років тому +22

    Don't think your Monty Python reference went unnoticed
    (Terrific and very helpful video, as always)

    • @statquest
      @statquest  5 років тому +2

      Thanks so much!!! :)

    • @ajha100
      @ajha100 4 роки тому +1

      Oh it absolutely did. And it was much loved!

  • @alexei.domorev
    @alexei.domorev 2 роки тому +2

    Josh - as always your videos are brilliant in their simplicity! Please keep up your good work!

  • @praveerparmar8157
    @praveerparmar8157 3 роки тому +1

    Just love the way you say 'BAM?'.....a feeling of hope mixed with optimism, anxiety and doubt 😅

  • @markparee99
    @markparee99 5 років тому +1

    Every time I think your video subject is going to be daunting, I find you explanation dispel that thought pretty quickly. Nice job!

  • @terrencesatterfield9610
    @terrencesatterfield9610 3 місяці тому +1

    Wow. This new understanding just slammed into me. Great job. Thank you.

    • @statquest
      @statquest  2 місяці тому

      Glad it was helpful!

  • @joaocasas4
    @joaocasas4 Рік тому +1

    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!

  • @ajha100
    @ajha100 4 роки тому +3

    I really appreciated the inclusion of swallow airspeed as a variable above and beyond the clear-cut explanation. Thanks Josh. ;-)

  • @hsinchen4403
    @hsinchen4403 4 роки тому +2

    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. :)

  • @atiqkhan7803
    @atiqkhan7803 6 років тому +1

    This is brilliant. Thanks for making it publicly available

    • @statquest
      @statquest  6 років тому +1

      You're welcome! :)

  • @RussianSUPERHERO
    @RussianSUPERHERO 2 роки тому +1

    I came for the quality content, fell in love with the songs and bam.

  • @TeXtersWS
    @TeXtersWS 5 років тому +1

    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. :)

  • @tymothylim6550
    @tymothylim6550 3 роки тому +2

    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)!

  • @joshuamcguire4832
    @joshuamcguire4832 4 роки тому +1

    a man of his word...very clearly explained!

  • @jasonyimc
    @jasonyimc 4 роки тому +5

    So easy to understand. And I like the double BAM!!!

  • @siriuss_7
    @siriuss_7 3 роки тому +1

    Your videos make it so easy to understand. Thank you!

  • @sanyuktasuman4993
    @sanyuktasuman4993 5 років тому +8

    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 років тому +2

      You should really check out the intro song for this StatQuest: ua-cam.com/video/D0efHEJsfHo/v-deo.html

  • @gregnelson8148
    @gregnelson8148 5 років тому +1

    You have a gift for teaching! Excellent videos!

  • @add6911
    @add6911 Рік тому +1

    Excelent video Josh! Amazing way to explain Statistics Thank you so much! Regards from Querétaro, México

  • @Azureandfabricmastery
    @Azureandfabricmastery 4 роки тому +1

    Hi Josh, Thanks for clear explanation on regularization techniques. very exciting. God bless for efforts.

  • @ayush612
    @ayush612 6 років тому +1

    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 років тому +1

      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

  • @hareshsuppiah9899
    @hareshsuppiah9899 4 роки тому +2

    Statquest is like Marshall Eriksen from HIMYM teaching us stats. BAM? Awesome work Josh.

  • @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!

  • @luispulgar7515
    @luispulgar7515 5 років тому +1

    Bam! I appreciate the pace of the videos. Thanks for doing this.

  • @kitkitmessi
    @kitkitmessi 2 роки тому +2

    Airspeed of swallow lol. These videos are really helping me a ton, very simply explained and entertaining as well!

  • @TheBaam100
    @TheBaam100 5 років тому +1

    Thank you so much for making these videos! Had to hold a presentation about LASSO in university.

    • @statquest
      @statquest  5 років тому +1

      I hope the presentation went well! :)

    • @TheBaam100
      @TheBaam100 5 років тому +1

      @@statquest Thx. It did :)

  • @ryanzhao3502
    @ryanzhao3502 5 років тому +2

    Thx very much. Clear explanation for these similar models. Great video I will conserve forever

  • @Endocrin-PatientCom
    @Endocrin-PatientCom 5 років тому +1

    Incredible great explanations of regularization methods, thanks a lot.

  • @abelgeorge4953
    @abelgeorge4953 11 місяців тому +2

    Thank you for clarifying that the Swallow can be African or European

  • @AnaVitoriaRodriguesLima
    @AnaVitoriaRodriguesLima 4 роки тому +2

    Thanks for posting, my new favourite youtube channel absolutely !!!!

  • @rezaroshanpour971
    @rezaroshanpour971 11 місяців тому +1

    Great....please continue to learn other models...thank you so much.

  • @alecvan7143
    @alecvan7143 5 років тому +13

    The beginning songs are always amazing hahaha!!

  • @apekshaagrawal6696
    @apekshaagrawal6696 4 роки тому +1

    Thanks for the Video. They make difficult concepts seem really easy..

  • @mahajanpower
    @mahajanpower 5 років тому +1

    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 років тому +1

      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 років тому +1

      StatQuest with Josh Starmer Thanks Josh for the updates. I’ll send you request at Linkedin.

  • @PythonArms
    @PythonArms Рік тому

    Harvard should hire you. Your videos never fail me!
    Thank you for such great content!

  • @cloud-tutorials
    @cloud-tutorials 5 років тому +1

    One more use case of Ridge/Lasso regression is 1) When data points are less 2) High Multicollinearity between variables

  • @hanadiam8910
    @hanadiam8910 2 роки тому +1

    Million BAM for this channel 🎉🎉🎉

  • @stefanomauceri
    @stefanomauceri 6 років тому +3

    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 років тому +1

      Yes I agree! Together these two could be the StatQuest manifesto summarising what people think about stats!

    • @statquest
      @statquest  6 років тому

      So true!

  • @flyingdutchmanSimon
    @flyingdutchmanSimon 3 роки тому +1

    Seriously the best videos ever!!

  • @UncleLoren
    @UncleLoren 4 роки тому

    Both the Ridge and Lasso videos made me want to cry. (Know you aren't alone if anyone else feels the same.) Also noteworthy: Ridge Regression avoids problems introduced by having more observations than predictor variables, or when multicollinearity is an issue. This example avoids either condition. Triple Bam. (Obviously, I am taking the definition too literally. It's a relative statement, re: the vars to observations ratio. )...Nevertheless, there's no end to my confusion. I was approaching "understanding", using the ISLR book....but you can actually get two different perspectives on the same topic, and then be worse off due to variance in how the concepts are presented. That said, you're still awesome, StatsQuest, and you are invited to play guitar at my funeral when I end things from trying to learn ML.

    • @UncleLoren
      @UncleLoren 4 роки тому

      (gonna check the StatsExchange link down below that you provided. Thank you, sir!!!)

  • @whispers191
    @whispers191 2 роки тому +1

    Thank you once again Josh!

  • @corneliusschramm5791
    @corneliusschramm5791 6 років тому +1

    Dude you are an absolute lifesaver! keep it up!!!

    • @statquest
      @statquest  6 років тому

      Hooray! I'm glad I could help. :)

  • @mrknarf4438
    @mrknarf4438 4 роки тому +2

    Great video, clear explanation, loved the Swallows reference! Keep it up! :)

  • @kd1415
    @kd1415 3 роки тому +1

    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 роки тому +1

      Love the fact that you reply to every single comment here in YT haha

  • @abdullahmoiz8151
    @abdullahmoiz8151 6 років тому +1

    Brilliant explanation
    didnt need to check out any other video

  • @davidmantilla1899
    @davidmantilla1899 2 роки тому +1

    Best youtube channel

  • @yilinxie2457
    @yilinxie2457 5 років тому

    Thanks! I finally understand how they shrink parameters!

  • @adwindtf
    @adwindtf 4 роки тому +1

    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

  • @rishabhkumar-qs3jb
    @rishabhkumar-qs3jb 3 роки тому +1

    Amazing video, explanation is fantastic. I like the song along with the concept :)

  • @arthurus8374
    @arthurus8374 3 роки тому +1

    so incredible, so well explained

  • @RenoyZachariah
    @RenoyZachariah 2 роки тому +1

    Amazing explanation. Loved the Monty Python reference :D

  • @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!!

  • @emmanueluche3262
    @emmanueluche3262 Рік тому +1

    Wow! so easy to understand this! Thanks very much!

  • @DonnyDonowitz22
    @DonnyDonowitz22 5 років тому

    The best explanation ever.

  • @MrArunavadatta
    @MrArunavadatta 4 роки тому +1

    wonderfully explained

  • @pratiknabriya5506
    @pratiknabriya5506 4 роки тому +4

    A StatQuest a day, keeps Stat fear away!

  • @tiborcamargo5732
    @tiborcamargo5732 6 років тому +5

    That Monty Python reference though... good video btw :)

    • @statquest
      @statquest  6 років тому

      Ha! I'm glad you like the video. ;)

  • @researchhub2727
    @researchhub2727 Місяць тому +1

    Excellent information

  • @SieolaPeter
    @SieolaPeter Рік тому +1

    Finally, I found 'The One'!

  • @longkhuong8382
    @longkhuong8382 6 років тому +1

    Hooray!!!! excellent video as always
    Thank you!

    • @statquest
      @statquest  6 років тому +1

      Hooray, indeed!!!! Glad you like this one! :)

  • @johnholbrook1447
    @johnholbrook1447 6 років тому +1

    Fantastic videos - very well explained!

  • @ninakumagai22
    @ninakumagai22 5 років тому +1

    My favourite youtuber!

  • @seahseowpeh8278
    @seahseowpeh8278 4 дні тому +1

    You are the best. Thank you so much

  • @lucianotarsia9985
    @lucianotarsia9985 3 роки тому +1

    Great video! The topic is really well explained

  • @anusrivastava5373
    @anusrivastava5373 4 роки тому

    I remember Phoebe while listening to your videos' beginning!!

    • @statquest
      @statquest  4 роки тому +1

      What about this intro song: ua-cam.com/video/D0efHEJsfHo/v-deo.html

    • @anusrivastava5373
      @anusrivastava5373 3 роки тому +1

      @@statquest haha!!

  • @faustopf-.
    @faustopf-. 3 роки тому +1

    Magnificent video

  • @arpitqw1
    @arpitqw1 5 років тому +3

    why can't ridge reduce weight/parameter to 0 like lasso?

  • @pelumiobasa3104
    @pelumiobasa3104 5 років тому +1

    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! :)

  • @KrizTahimic
    @KrizTahimic Рік тому +1

    Amazing! Thank you so much for this!

  • @gdivadnosdivad6185
    @gdivadnosdivad6185 Рік тому +1

    You are the best! I understand it now!

  • @zebralemon
    @zebralemon Рік тому +1

    I enjoy the content and your jam so much! '~Stat Quest~~'

  • @chadmadding
    @chadmadding 5 років тому +1

    Always amazing videos.

  • @sandipansarkar9211
    @sandipansarkar9211 3 роки тому +1

    Great explanation

  • @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.

  • @jamalshah2210
    @jamalshah2210 2 роки тому

    Thank you Josh for sharing this video. Could you please do a video on Bayesian statistics and Monte Carlo methods?

    • @statquest
      @statquest  2 роки тому

      I hope to do bayesian statistics soon.

  • @johnalvinm
    @johnalvinm Рік тому +1

    This was gold!

  • @raymilan2301
    @raymilan2301 4 роки тому +1

    Thanks a lot for the explanation !!!

  • @yulinliu850
    @yulinliu850 6 років тому +1

    Thanks Josh!

  • @luisakrawczyk8319
    @luisakrawczyk8319 5 років тому +7

    How do Ridge or Lasso know which variables are useless? Will they not also shrink the parameter of important variables ?

    • @suriahselvam9066
      @suriahselvam9066 5 років тому +1

      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.

  • @rishatdilmurat8913
    @rishatdilmurat8913 Рік тому +1

    Vey nice explanations, it is better than UDEMY!

  • @simrankalra4029
    @simrankalra4029 5 років тому +2

    Thankyou Sir ! Great Help.

  • @leandadearaujo5559
    @leandadearaujo5559 5 років тому +1

    awesome your explanation just simplifies everything
    request to make videos on rest of the algorithms as well
    thank you

    • @statquest
      @statquest  5 років тому

      I'm working on them :)