StatQuest: K-nearest neighbors, Clearly Explained

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

КОМЕНТАРІ • 437

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

    Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/

  • @raytang1867
    @raytang1867 5 років тому +485

    Five minutes explains better than some teachers spent one hour. :)

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

      Thank you! :)

    • @free_thinker4958
      @free_thinker4958 4 роки тому +20

      Better than teacher spending semester for me

    • @TeacherMarcus1010
      @TeacherMarcus1010 3 роки тому

      hahahahaha

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

      @@free_thinker4958 wtf really? also my teacher took 5 minutes that's why I understood nothing

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

      For real, this channel is a godsend.

  • @alexanderpalm6407
    @alexanderpalm6407 4 роки тому +151

    Whenever I search for a video tutorial, and you pop up in the search results, my heart fills with joy!!! ^^
    Thank you once again!

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

      Hooray!!!!! :)

    • @siddheshbalsaraf1776
      @siddheshbalsaraf1776 3 роки тому

      same here ..not started the video yet but only 1 video on knn .....dont know if i can understand very very well like linear regression

  • @thinkalinkle
    @thinkalinkle 5 років тому +158

    I'm taking a machine learning course at university, and I've been blessed with having found your channel. Keep up the great content!

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

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

  • @mandarkulkarni4741
    @mandarkulkarni4741 4 роки тому +62

    INTRO IS LEGENDARY BRO : )

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

      Yup, that's a good one. :)

  • @spacemeter3001
    @spacemeter3001 3 роки тому +14

    When a random UA-cam channel explains it better than your University Professor....
    Keep it up!

  • @rahulsadanandan5076
    @rahulsadanandan5076 3 роки тому +25

    Every time I see your videos I'm simply amazed how you manage to make things simple,it's like 1+1=2, respect

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

    it is good to listen to your music in your website after watching this clear-explained video. thanks a lot.

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

      Thank you so much! :)

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

    This is by far the best video on KNN algo ! Thanks Josh

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

      You are doing awesome work Sir..have watched your other videos as well..very intuitive and logically explained

  • @user-pn3vw9sp5f
    @user-pn3vw9sp5f 3 місяці тому +3

    This channel is salt of the Earth

  • @atifayaz3495
    @atifayaz3495 3 роки тому +5

    When I search for something and find it on StatQuest channel. Super BAM!!

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

    Thank you josh and the FFGDUNCCH (the friendly folks from the genetics department at the university of north carolina at chapel hill)

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

    I can't believe how good you are at explaining this. wow!!!

  • @Oliver-nt8pw
    @Oliver-nt8pw 5 років тому +6

    Thank you, very clear and to the point explanation !

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

    Very clear, I got the idea of this concept right away.
    Well done, thanks!

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

    Thank you so much. So useful honestly - i didnt get this from a 2 hour lecture

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

      Glad it was helpful!

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

    Thank you! This helped me so much in understanding KNN faster :D

  • @qicai3682
    @qicai3682 Рік тому +2

    This channel is GOD SENT. Period.

  • @kuangliew
    @kuangliew 6 років тому +2

    Amazing explanation! Thank you!

  • @fafamnzm3126
    @fafamnzm3126 6 років тому +9

    Your videos are sooo great, I can't stop watching 💖💖 thank you

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

      Hooray!!!!

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

      StatQuest with Josh Starmer can you add an ICA as well?

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

      It's on the to-do list, but it might be a while before I get to it.

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

      StatQuest with Josh Starmer 😔😕 that's sad, but i look forward to it. You explain beautifully sir! 💪🏼👊🏼

  • @Guinhulol
    @Guinhulol 5 місяців тому +1

    I am brushing up on my ML terminology and StatQuest always comes to the rescue!! BAM!

  • @user-by8sn4km5q
    @user-by8sn4km5q 2 місяці тому +1

    WOWW! This was super helpful!
    Thanks Josh!

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

      Glad it was helpful!

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

    Thank you for your Clear explanation.

  • @prekshyabasnet6854
    @prekshyabasnet6854 4 роки тому +6

    Clear and concise explanation. Thank you :)

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

    Thank you. Very good explanation in such a short time.

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

    I am so glad I found this channel.

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

    Very well explained and loved your uke intro by the way :)

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

    Another exciting episode of statquest!

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

    Easy to understand and straightforward. Thanks.

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

    Simple and Clear explanation. Thank you!

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

    Ohhh man this so simple
    Thqqq for this type of explanation

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

    BAM!!! That was great as usual.

  • @Maddie-gt6pn
    @Maddie-gt6pn 4 роки тому +1

    such an amazing explanation. Thank you!

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

    awesome explanation ! thank you so much!

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

    You're a legend at explaining.

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

    BAM! Amazing explanation!

  • @grovvy_essence.1070
    @grovvy_essence.1070 2 роки тому +1

    Loved it.... Thank you 😊

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

    Bam! Smart and clear as usual.

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

    Many thanks for the clear explanation

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

    Thank you so much for saving our time sir❤ love from Srilanka 🇱🇰

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

    Wow! such a great explainer

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

    Great explanation! BAM! Great illustrations! Double BAM!!

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

      Thank you very much! :)

  • @VH-yg8rx
    @VH-yg8rx Рік тому +1

    Dang. Simple and to the point! Thank you!

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

    I love you sir! Your video save my life!

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

    thank you so much.This was well explained.

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

    That opening banjo solo is prettt sweet.

  • @lilmoesk899
    @lilmoesk899 7 років тому +2

    Good stuff, thanks! Do you have any videos about survival analysis?

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

    Summarised in a very short video....just perfect

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

    Best explanation ever, thank you!!!

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

    Great tutorial!

  • @THEMATT222
    @THEMATT222 2 роки тому +5

    Your videos are K-nearest perfection :)

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

      Ha! Very funny.

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

      @@statquest Noice 👍 Thanks 👍

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

    Well explained, thank you good sir!

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

    you are the master of machine learning

  • @eltajbabazade1189
    @eltajbabazade1189 3 роки тому +3

    Man, you are a legend, if I pass from the exam on Monday (which I am pretty hopeless), I will buy one of your shirts next month

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

      Hooray! Good luck with your exam! :)

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

      @@statquest Hey, I failed :D but still, I learnt a lot, thanks!

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

      @@eltajbabazade1189 Better luck next time! :)

    • @MillerMoore-gq2pe
      @MillerMoore-gq2pe 15 днів тому

      @@eltajbabazade1189 I hope you graduated successfully 🙂.

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

    BAM!!! You nailed it.

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

    You are amazing! Thank u so much.
    Cheers from BRAZIL

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

    Thank you so much

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

    You are awesome man!!

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

    BAM!

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

    THANK YOU JOSH!

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

    You're a legend ! Thank you :)

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

    lifesaver! thank you!

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

    Thanks sir, great explanation!

  • @MB-vd6hc
    @MB-vd6hc 4 роки тому +1

    Thanks alot for this video.

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

    Thank you!

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

    Good job ! I loved the videooo :)

  • @tanguyvranckx1134
    @tanguyvranckx1134 6 місяців тому +1

    Where would I be without StatQuest? Luckily, I now have the statistical tool to estimate this!

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

    Omg, thank you so much!!!!!

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

    Nice video well done

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

    was extremely helpful tysm

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

    THANK YOU!
    YOU HAVE SAVED ME :D

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

    awesome! You should do a quadratic discriminant analysis to go with your awesome one on LDA

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

    Your video is amazing as always... It would be great if you can include how to choose the value for 'k' and evaluation metrics for kNN. Also, if I understand it right, there is no actual "training" happening in kNN. It is about arranging the points on the cartesian plane and when a new data point comes, it will again be placed on the same plane and depending on the value of "k", it will be classified. Correct me if I'm wrong.

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

      Hi. Yes, you are right. KNN is easy to implement and understand and has been widely used in academia and industry for decades. You may utilise the cross-validation technique and the validation datasets to select the value for k.

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

    one video explained better than a whole semester

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

    Excellent

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

      Thank you so much 😀

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

    Omg thank you so much

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

    Amazing!

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

    great video

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

    These videos are just amazing and clearly are extremely successful in simplifying topics that are usually thought of as difficult. Can you please also make videos on its code in python/R..? and of naive bayes too maybe. That would be super useful. Thank you very much for this level of awesome content.

    • @statquest
      @statquest  29 днів тому

      I'll keep that in mind.

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

    Thanks!

  • @gooo1762
    @gooo1762 4 місяці тому +1

    thanks a lot bro

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

    Hello Josh how are you. I was wondering if you may kindly explain the Naive Bayes, to be clearly explained :)

  • @sanaali3069
    @sanaali3069 10 місяців тому +1

    My 10 year old hums statquest song made me realise I my new obsession with this

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

    thanks nice tutorial

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

    I like your bandcamp!

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

      Hooray! Thank you! :)

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

    It is unfair that I can't give this video another like.

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

    Thanks for your youtube :)

  • @unnatinandrekar99
    @unnatinandrekar99 3 роки тому

    Your videos are really great! Clear and detailed explanation. Can you please make a similar detailed playlist for neural networks?

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

      I'm working on it. I have 5 videos so far, and 5 more to go before I have the whole playlist. Here's the link to the first one: ua-cam.com/video/CqOfi41LfDw/v-deo.html and the other links are here: statquest.org/video-index/

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

      @@statquest Yes I have seen those videos, just wanted to know whether there are more videos to come. Eagerly waiting!

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

      @@unnatinandrekar99 The next one comes out on Monday, and then the rest will come out, one or two per week, for the next month.

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

      @@statquest BAM!!!! That's prefect!!!!!!!!

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

    please do statquest videos on complete model building projects in R!!

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

    Hey Josh! This is just a thank you note saying if I pass the upcoming exam, then it would be all because of you! ❤

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

      Good luck!!! Let me know how it goes!

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

      @@statquest It went well, thank you! Hopefully I get good grades. I was thinking of suggesting that it would be great if you could cover Markov Chain Monte Carlo and related topics. Thank you again! Your channel has been incredibly helpful!

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

      @@suparnaroy2829 I'm glad it went well! And I'll keep those topics in mind.

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

    that was exciting indeed

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

    BAM subscribed.

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

    Just wow thanks Josh. You are just great. One doubt however, if k values are large will outliers not affect my algo? Effect of outliers in knn? Please answer.

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

      I believe that large values for K will provide some protection from outliers.

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

    Thanks for the very informative info ! Though I have a question , if my dataset is filled with just categorical string data. So no numerical data . Is there a way I can still use knn to predict ? I heard about encoding the string to numerical value but that seems very complex with big dataset .

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

      If you use R, then you can use a Random Forest to cluster anything and then apply KNN to that clustering: ua-cam.com/video/sQ870aTKqiM/v-deo.html If you don't use R, you can use target encoding: ua-cam.com/video/589nCGeWG1w/v-deo.html

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

    Thank you very much for your amazing work! Question kind of not related, but I was wondering: is there any explanation on euclidean distance calculated in stata as well? Thanks!

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

      Unfortunately I don't know how to use stata.

  • @maryamzirak6291
    @maryamzirak6291 8 місяців тому

    That is awsom how you explain this topics. One suggestion, you could show how the 7 nearest ist red, 3 nearest ist orange and 1 nearest is green for the point in the middle. By my eyes, the 1 nearest neigbour ist still red! and it makes me confuse what does nearest means actually :)

    • @statquest
      @statquest  8 місяців тому

      What time point, minutes and seconds, are you referring to?

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

    awesome again

  • @mengxiaozhang3035
    @mengxiaozhang3035 3 роки тому

    Just come across the video! Love it!! It's really clear and easy to follow! :D I have a question regarding the steps. For step 1, you said it would be used for known categories, and Im looking to use this method for unknown categories. Since we know all most of the traits, is there anyway to create categories using those characteristics? I'm new for machine learning and I wonder is there any method for this?

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

      It depends on a lot of things. Creating categories from the raw data can be very subjective.

    • @mengxiaozhang3035
      @mengxiaozhang3035 3 роки тому

      @@statquest Would it be possible to categorize items having trait 1,2,3,4 using similarity tests? But then the question is then where to start with.

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

    thanks you

  • @aashidm
    @aashidm 4 місяці тому

    00:10 K-nearest neighbors is a simple algorithm for classifying data.
    00:50 Clustering data using PCA and classifying new cell type
    01:29 K-nearest neighbors classifies new data based on nearest annotated cells.
    02:12 K-nearest neighbors algorithm assigns a category based on the majority of nearest neighbors' votes.
    02:59 K-nearest neighbors algorithm classifies unknown points based on nearest neighbors
    03:40 K-nearest neighbors can avoid ties by using an odd K value.
    04:22 Choosing the best value for K is crucial for K-nearest neighbors.
    05:01 Categories with few samples are outvoted

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

      You forgot the bam! :)