Regularization Part 2: Lasso (L1) Regression

Sdílet
Vložit
  • čas přidán 5. 06. 2024
  • Lasso Regression is super similar to Ridge Regression, but there is one big, huge difference between the two. In this video, I start by talking about all of the similarities, and then show you the cool thing that Lasso Regression can do that Ridge Regression can't.
    NOTE: This StatQuest follows up on the the StatQuest on Ridge Regression:
    • Regularization Part 1:...
    For a complete index of all the StatQuest videos, check out:
    statquest.org/video-index/
    If you'd like to support StatQuest, please consider...
    Buying The StatQuest Illustrated Guide to Machine Learning!!!
    PDF - statquest.gumroad.com/l/wvtmc
    Paperback - www.amazon.com/dp/B09ZCKR4H6
    Kindle eBook - www.amazon.com/dp/B09ZG79HXC
    Patreon: / statquest
    ...or...
    CZcams Membership: / @statquest
    ...a cool StatQuest t-shirt or sweatshirt:
    shop.spreadshirt.com/statques...
    ...buying one or two of my songs (or go large and get a whole album!)
    joshuastarmer.bandcamp.com/
    ...or just donating to StatQuest!
    www.paypal.me/statquest
    Lastly, if you want to keep up with me as I research and create new StatQuests, follow me on twitter:
    / joshuastarmer
    #statquest #regularization

Komentáře • 642

  • @statquest
    @statquest  Před 2 lety +12

    If you want to see why Lasso can set parameters to 0 and Ridge can not, check out: czcams.com/video/Xm2C_gTAl8c/video.html
    Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/

  • @citypunter1413
    @citypunter1413 Před 5 lety +64

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

  • @marisa4942
    @marisa4942 Před 2 lety +35

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

  • @hughsignoriello
    @hughsignoriello Před rokem +13

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

  • @patrickwu5837
    @patrickwu5837 Před 4 lety +24

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

  • @qiaomuzheng5800
    @qiaomuzheng5800 Před 2 lety +10

    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.

  • @anuradhadas8795
    @anuradhadas8795 Před 3 lety +36

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

    • @statquest
      @statquest  Před 3 lety +1

      :)

    • @SaiSrikarDabbukottu
      @SaiSrikarDabbukottu Před 7 měsíci

      ​@@statquestCan you please explain how the irrelevant parameters "shrink"? How does Lasso go to zero when Ridge doesn't?

    • @statquest
      @statquest  Před 7 měsíci

      @@SaiSrikarDabbukottu I show how it all works in this video: czcams.com/video/Xm2C_gTAl8c/video.html

  • @markparee99
    @markparee99 Před 5 lety +1

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

  • @gonzaloferreirovolpi1237
    @gonzaloferreirovolpi1237 Před 5 lety +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!

  • @admw3436
    @admw3436 Před 5 lety +15

    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  Před 5 lety +3

      I love it!!! Glad my video is helpful! :) p.s. I got the joke too. Nice! ;)

    • @ak-ot2wn
      @ak-ot2wn Před 4 lety

      Why is this scenario many times the reality? Also, I check StatQuest's vids very often to really understand the things. Thanks @StatQuest

  • @chrisg0901
    @chrisg0901 Před 5 lety +21

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

    • @statquest
      @statquest  Před 5 lety +2

      Thanks so much!!! :)

    • @ajha100
      @ajha100 Před 4 lety +1

      Oh it absolutely did. And it was much loved!

  • @perrygogas
    @perrygogas Před 5 lety +171

    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  Před 5 lety +88

      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 Před 5 lety +5

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

    • @gauravms6681
      @gauravms6681 Před 5 lety +3

      @@statquest yes we need it please do plsssssssssssssssssssssssssssssssss
      plsssssssssssssssssssssssssssssssssssssssssssssss

    • @InfinitesimallyInfinite
      @InfinitesimallyInfinite Před 5 lety +10

      Bootstrapping is explained well in Random Forest video.

    • @miguelsaravia8086
      @miguelsaravia8086 Před 4 lety +1

      Do it for us... thanks good stuff

  • @Jenna-iu2lx
    @Jenna-iu2lx Před rokem +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! 💯☺

  • @alexei.domorev
    @alexei.domorev Před rokem +2

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

  • @tymothylim6550
    @tymothylim6550 Před 3 lety +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)!

  • @Jan-oj2gn
    @Jan-oj2gn Před 5 lety +2

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

  • @Phobos11
    @Phobos11 Před 5 lety +260

    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  Před 5 lety +139

      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  Před 5 lety +34

      @@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 Před 5 lety +25

      @@statquest Thanks for reading the comments and responding!

    • @statquest
      @statquest  Před 5 lety +29

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

    • @Phobos11
      @Phobos11 Před 5 lety +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

  • @luispulgar7515
    @luispulgar7515 Před 5 lety +1

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

  • @TeXtersWS
    @TeXtersWS Před 5 lety +1

    Explained in a very simple yet very effective way! Thank you for your contribution Sir

    • @statquest
      @statquest  Před 5 lety

      Hooray! I'm glad you like my video. :)

  • @sanyuktasuman4993
    @sanyuktasuman4993 Před 4 lety +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  Před 4 lety +2

      You should really check out the intro song for this StatQuest: czcams.com/video/D0efHEJsfHo/video.html

  • @atiqkhan7803
    @atiqkhan7803 Před 5 lety +1

    This is brilliant. Thanks for making it publicly available

  • @ryanzhao3502
    @ryanzhao3502 Před 5 lety +2

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

  • @naomichin5347
    @naomichin5347 Před 2 lety +1

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

    • @statquest
      @statquest  Před 2 lety +1

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

  • @ayush612
    @ayush612 Před 5 lety +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  Před 5 lety +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 Před 5 lety

      @@statquest please keep on going... You are our saviour

  • @takedananda
    @takedananda Před 4 lety +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  Před 4 lety

      Awesome!! I'm glad the video was helpful. :)

  • @jasonyimc
    @jasonyimc Před 3 lety +5

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

  • @simsim2159
    @simsim2159 Před 3 lety +1

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

  • @AnaVitoriaRodriguesLima
    @AnaVitoriaRodriguesLima Před 4 lety +2

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

  • @Endocrin-PatientCom
    @Endocrin-PatientCom Před 4 lety +1

    Incredible great explanations of regularization methods, thanks a lot.

  • @kyoosikkim749
    @kyoosikkim749 Před 5 lety

    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!

  • @alecvan7143
    @alecvan7143 Před 4 lety +13

    The beginning songs are always amazing hahaha!!

  • @RussianSUPERHERO
    @RussianSUPERHERO Před 2 lety +1

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

  • @ajha100
    @ajha100 Před 4 lety +3

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

  • @longkhuong8382
    @longkhuong8382 Před 5 lety +1

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

    • @statquest
      @statquest  Před 5 lety +1

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

  • @gregnelson8148
    @gregnelson8148 Před 4 lety +1

    You have a gift for teaching! Excellent videos!

  • @pelumiobasa3104
    @pelumiobasa3104 Před 4 lety +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

  • @corneliusschramm5791
    @corneliusschramm5791 Před 5 lety +1

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

    • @statquest
      @statquest  Před 5 lety

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

  • @hsinchen4403
    @hsinchen4403 Před 4 lety +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  Před 4 lety

      Awesome! I'm glad the videos are helpful. :)

  • @sophie-ev1mr
    @sophie-ev1mr Před 4 lety

    Thank you so much for these videos you are a literal godsend. You should do a video on weighted least squares!!

  • @mrknarf4438
    @mrknarf4438 Před 4 lety +2

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

  • @yuzaR-Data-Science
    @yuzaR-Data-Science Před 5 lety +2

    Thanks a lot! Amazing explanation! Please, continue the great work and add more on statistics, probability in general and machine learning in particular. Sinse Data Science suppose to have a great future, I am certain that your channel also will prosper a great deal!

  • @kitkitmessi
    @kitkitmessi Před 2 lety +2

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

  • @yilinxie2457
    @yilinxie2457 Před 5 lety

    Thanks! I finally understand how they shrink parameters!

  • @joshuamcguire4832
    @joshuamcguire4832 Před 3 lety +1

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

  • @add6911
    @add6911 Před rokem +1

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

  • @rishabhkumar-qs3jb
    @rishabhkumar-qs3jb Před 3 lety +1

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

  • @whispers191
    @whispers191 Před 2 lety +1

    Thank you once again Josh!

  • @johnholbrook1447
    @johnholbrook1447 Před 5 lety +1

    Fantastic videos - very well explained!

  • @qorbanimaq
    @qorbanimaq Před 4 lety +1

    Ah! A triple THANKSSSS!!!!. I finally got what they are really doing.

  • @Azuremastery
    @Azuremastery Před 4 lety +1

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

  • @flyingdutchmanSimon
    @flyingdutchmanSimon Před 3 lety +1

    Seriously the best videos ever!!

  • @DonnyDonowitz22
    @DonnyDonowitz22 Před 5 lety

    The best explanation ever.

  • @simrankalra4029
    @simrankalra4029 Před 4 lety +2

    Thankyou Sir ! Great Help.

  • @TheHerbert4321
    @TheHerbert4321 Před 3 lety

    I love your style of explaining! You leave enough time for anyone to take in all information while talking. Sometimes it feels like you are trying to teach little kids, but it actually just works. I often watch other teaching videos and can't remember most of it afterwards, but I can remember almost everything that you are saying after the first time watching. Amazing job!
    I have one question though. You were saying that the regression model in the beginning had low bias and high variance. Does it not have high bias? As far as I know bias represents the expected generalization (or test) error, if we were to fit a very large training set. If we fit that simple model to a lot of data, the generalization error would be rather high, because it could not capture the true patterns in the data.

    • @statquest
      @statquest  Před 3 lety

      I'm glad you like the videos! In ML, there are specific meanings for bias and variance that are a little bit different from what you are using and I explain in this StatQuest: czcams.com/video/EuBBz3bI-aA/video.html

  • @praveerparmar8157
    @praveerparmar8157 Před 3 lety +1

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

  • @joaocasas4
    @joaocasas4 Před rokem +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!

  • @abdullahmoiz8151
    @abdullahmoiz8151 Před 5 lety +1

    Brilliant explanation
    didnt need to check out any other video

  • @lihuang919
    @lihuang919 Před 5 lety

    Great video! I finally understand!

  • @TheBaam100
    @TheBaam100 Před 4 lety +1

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

    • @statquest
      @statquest  Před 4 lety +1

      I hope the presentation went well! :)

    • @TheBaam100
      @TheBaam100 Před 4 lety +1

      @@statquest Thx. It did :)

  • @chadmadding
    @chadmadding Před 5 lety +1

    Always amazing videos.

  • @mahajanpower
    @mahajanpower Před 4 lety +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  Před 4 lety +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 Před 4 lety +1

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

  • @codewithsid2063
    @codewithsid2063 Před 5 lety +1

    Keep it up man. Awesome content.

  • @luigineri4364
    @luigineri4364 Před 5 lety

    Hi thanks I think the videos are great and also I like your songs. You are very talented.
    In looking at this video I was thinking that Lasso regression can be used as a form of variable selection. Is this a good idea? So basically at first you include all the predictors then the lasso will tell which variable you need to get rid off. Does this make sense?

  • @hareshsuppiah9899
    @hareshsuppiah9899 Před 3 lety +2

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

  • @lucianotarsia9985
    @lucianotarsia9985 Před 3 lety +1

    Great video! The topic is really well explained

  • @arthurus8374
    @arthurus8374 Před 2 lety +1

    so incredible, so well explained

  • @emmanueluche3262
    @emmanueluche3262 Před rokem +1

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

  • @apekshaagrawal6696
    @apekshaagrawal6696 Před 3 lety +1

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

  • @user-ur2en1zq4f
    @user-ur2en1zq4f Před rokem +1

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

  • @khanhtruong3254
    @khanhtruong3254 Před 5 lety +2

    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?

  • @KrizTahimic
    @KrizTahimic Před 9 měsíci +1

    Amazing! Thank you so much for this!

  • @akronmom9037
    @akronmom9037 Před 4 lety

    Thank you for uploading this video. Can you upload a video explaining the difference between Lasso and Group Lasso? Thanks again.

  • @zebralemon
    @zebralemon Před rokem +1

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

  • @clementbourgade2487
    @clementbourgade2487 Před 3 lety +1

    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 !

  • @pratiknabriya5506
    @pratiknabriya5506 Před 4 lety +4

    A StatQuest a day, keeps Stat fear away!

  • @MrArunavadatta
    @MrArunavadatta Před 3 lety +1

    wonderfully explained

  • @faustopf-.
    @faustopf-. Před 2 lety +1

    Magnificent video

  • @raymilan2301
    @raymilan2301 Před 4 lety +1

    Thanks a lot for the explanation !!!

  • @leandadearaujo5559
    @leandadearaujo5559 Před 5 lety +1

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

  • @johnalvinm
    @johnalvinm Před rokem +1

    This was gold!

  • @KansasFashion
    @KansasFashion Před 3 lety +1

    Love this song bro!

  • @gdivadnosdivad6185
    @gdivadnosdivad6185 Před 7 měsíci +1

    You are the best! I understand it now!

  • @ainiaini4426
    @ainiaini4426 Před rokem +1

    Hahaha.. That moment you said BAM??? I laughed out loud 🤣🤣🤣

  • @yulinliu850
    @yulinliu850 Před 5 lety +1

    Thanks Josh!

  • @nurainibrahim9251
    @nurainibrahim9251 Před 5 lety +1

    BAM!! clearly explained!!

    • @statquest
      @statquest  Před 5 lety

      Hooray! I'm glad you like the video. :)

  • @kd1415
    @kd1415 Před 2 lety +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  Před 2 lety

      Glad it was helpful!

    • @kd1415
      @kd1415 Před 2 lety +1

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

  • @2210duynn
    @2210duynn Před 4 lety +1

    Very good video. You help me alot !!!!

  • @hanadiam8910
    @hanadiam8910 Před rokem +1

    Million BAM for this channel 🎉🎉🎉

  • @cloud-tutorials
    @cloud-tutorials Před 5 lety +1

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

  • @rezaroshanpour971
    @rezaroshanpour971 Před 5 měsíci +1

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

  • @alessandrofesti208
    @alessandrofesti208 Před 5 lety +1

    You're great!! Thank You

  • @pomegranate8593
    @pomegranate8593 Před rokem +1

    me: wathcing these videos in full panic
    video: plays calming music
    me: :)

  • @gmshadowtraders
    @gmshadowtraders Před 2 lety +1

    This is dope fam!

  • @RAJIBLOCHANDAS
    @RAJIBLOCHANDAS Před rokem +1

    Nice explanation!

  • @hosseineyvazi3122
    @hosseineyvazi3122 Před rokem +1

    keep up ur work bro .

  • @sandipansarkar9211
    @sandipansarkar9211 Před 3 lety +1

    Great explanation

  • @stefanomauceri
    @stefanomauceri Před 5 lety +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  Před 5 lety

      That’s one of my favorite intros too! :)

    • @statquest
      @statquest  Před 5 lety

      But I think my all time favorite is the one for LDA.

    • @stefanomauceri
      @stefanomauceri Před 5 lety +1

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

    • @statquest
      @statquest  Před 5 lety

      So true!

  • @abdulazizalhaidari7665
    @abdulazizalhaidari7665 Před 22 dny +1

    Great work, Thank you Josh,
    I'm trying to connect ideas from different perspectives/angles, Does the lambda here somehow related to Lagrange multiplier ?

  • @mohitkushwaha8974
    @mohitkushwaha8974 Před rokem +1

    awesome video

  • @davidmantilla1899
    @davidmantilla1899 Před 2 lety +1

    Best youtube channel