KNN Algorithm using Python | How KNN Algorithm works | Python Data Science Training | Edureka

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

КОМЕНТАРІ • 70

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

    Got a question on the topic? Please share it in the comment section below and our experts will answer it for you. For Edureka Python Machine Learning Course curriculum, Visit our Website: bit.ly/2OpzQWw

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

    can't imagine data processing without pandas,numpy but with for loops..

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

    hello and thanks for ur hard work...wish you'd explained the codes alittle bit.

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

    Explanation of theory was superb..
    Sir, plz try to explain coding as well.
    Overall good session.

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

      Thank you for appreciating our efforts. We will definitely look into your suggestions. Do subscribe to our channel and stay connected with us. Cheers :)

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

    Great video it helps a lot

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

    best explanation i found on the internet till date

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

    Great, it was magical! thanks

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

    Too nice thnk u

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

    Thanks ....got the concept

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

    Super sir

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

    realy nice. nice job

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

    very good explaination

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

    very good content and explanation. it will be good if you talk little slow. will be easy to understand.

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

      Hey Nitin, glad to hear you loved our content. Thanks for the feedback, we will keep that in mind in the future. Do subscribe to our channel to never miss an update from edureka. Thanks! :)

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

    If a give an input list for the KNN algorithm to predict the classes of each element, How can I print out the list of inputs only belonging to a particular class?

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

    Excellent video and superb explanation. Could you please share the source code?

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

    It would be better to include few important steps like cross-validation, standardization of data and in the end touch some base on optimum K (error rate vs k -value). Just 2 cents. Other wise good job.

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

      We try to show the most optimal executions and make sure that everyone is able to understand it efficiently. We will make sure that next time, we include this and give some more detailed explanation. Thank you.

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

    Thanks a ton..Reallly good video :-)

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

      Thanks for the compliment Jeevan! We are glad you loved the video. Do subscribe and hit the bell icon to never miss an update from us in the future. Cheers!

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

    At 12:43 in loadDataset method, in the line (for y in range(4)). Why have you used the value 4 ? What is its significance ?

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

      Hi Soumya, for every element present in x, there will be four iterations.

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

    Well explained!

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

    Really helpful video.Thanks!!
    Do u know how to do predictions on yearly data in python. Which method will be appropriate for this?

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

      Thanks for appreciating our efforts! Time Series will be appropriate for this.

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

      @@edurekaIN thanks

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

    thank you

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

    thanks for such a superb explanation

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

    Hi sir.. Nice explanation.. But i wonder with libraries available in scikitlearn and pandas y dont u code with them and show.. As anyways we will not be using these lengthy codes in real time..

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

      Hi Krishna, thanks for the compliment. We do have other videos on scikitlearn and pandas. This video is specifically about understanding the KNN algorithm concept. So, we have used the complex code to explain that.

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

    what a great explanation about KNN. I like your explanation..Really helpful to beginners . Thanks

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

    Thank you so much. From where could I have the code?

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

      Glad you liked it ! We are glad to have learners like you .Drop your mail id in the comment section for us to share the data sheets or source codes :) Do subscribe our channel and hit that bell icon to never miss an video from our channel

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

    Sir,
    Your video is really informative....

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

    I am extremely happy with this excellent presentation. Thank you.

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

      Hey j dharmendar, we are glad you loved the video. Do subscribe and hit the bell icon to never miss an update from us in the future. Cheers!

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

    Ho..is it possible to get this code

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

    it was supeb explanation

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

    can we built gu interface in python for prediction

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

      Hi Gagan! Yes, you can build a Graphic user interface with the help of Tkinter

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

      @@edurekaIN okay. Thnku. But i am working on anaconda spyder. Can we built gui in spyder also for predicted system

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

    Dear Edureka team
    Also please provide a KNN algorithm in R session online video

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

      Hey Airbornetroops, we will definitely look into your suggestions. Do subscribe and stay tuned to any updates on our channel. Cheers :)

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

    If I got same distance then what should we do???

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

      Hi Sai, It really depends on how you want to implement it.
      Most algorithms will do one of three things:
      Include all equal distance points, so for this estimation, they'll use 6 points, not 5.
      Use the ""first"" found point of the two equidistant.
      Pick a random (usually with a consistent seed, so results are reproducible) point from the 2 points found.
      That being said, most algorithms based on radial searching have an inherent assumption of stationarity, in which case, it really shouldn't matter which of the options above you choose. In general, any of them should, theoretically, provide reasonable defaults (especially since they're the furthest points in the approximation, and should have the lowest effective weightings).

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

    how to draw the decision boundaries?

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

      Refer to this link to resolve your query - stats.stackexchange.com/questions/370531/knn-decision-boundary

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

    now how would I plot the data?

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

      You can make use of seaborn functions to plot this data. For a complete Seaborn tutorial, you can follow the link: bit.ly/34u41mG

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

    Can u plz provide me the data set

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

      Hi Sagarika, kindly drop in your email id to help us assist you with the required source codes :)

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

    How do we choose the optimum value of K

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

      The optimum K will always vary depending on your data-set. It should be as big that noises won't affect the prediction highly. And as low that one factor won't dominate another. Some claim that the square root of n is a good number. But, I think the best method is to try many K values and use Cross-Validation to see which K value is giving the best result.

  • @GurjantSingh-if9ty
    @GurjantSingh-if9ty 6 років тому

    How to optimize knn algorithm to get more accuracy?

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

      Hey Gujrant, simplest solution is to use K-Fold Cross Validation or using the technique of bootstrapping. Hope this helps!

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

    sir i request you to please provide us your mail id so that i could able to ask you some basic question regarding ML

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

      Hey Amrita, please feel free to ask your queries over here and we will try our best to answer it for you. Cheers!

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

    can we predict gender of human being based on height and weight using KNN classifier?

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

      Hi Lakshmi! Yes, KNN is a classification algorithm and it can be used to predict the gender of a human based on available parameters. Hope this helps.

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

    dear edurka team i need this python code plz help me to provide

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

      Please share your email id with us (it will not be published). We will forward the source code to your email address.

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

    You said you will also implement KNN with Scikit Learn Library but you did not.

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

      Hey Naresh, Thanks for the feedback. We will definitely look into your suggestion. Do subscribe, like and share to stay connected with us. Cheers!

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

    How do we take k value randomly?

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

      Hey Vikash, "The simplest solution is probably K-Fold Cross Validation.en.wikipedia.org/wiki/Cross-validation_(statistics)#K-fold_cross-validation
      An alternative, widely used technique is bootstrapping. The choice of K equal to the square root of the number of instances is an empirical rule-of-thumb popularized by the ""Pattern Classification"" book , it is probably a good starting point"
      Hope this helps!

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

    how to take k value

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

      Hey Mahesh, set k = n^(1/2).

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

    What makes Knn algorithm slow? Value of K?

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

      Hey Kalyani, "Since KNN algorithm considers the nearest neighbous, the algortithm becomes slow when you have many neighbours as the training set.
      'K’ in KNN is the number of nearest neighbours used to classify or (predict in case of continuous variable/regression) a test sample"
      Hope this helps!