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
Thank you for appreciating our efforts. We will definitely look into your suggestions. Do subscribe to our channel and stay connected with us. Cheers :)
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! :)
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?
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.
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.
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!
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..
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.
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
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).
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.
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!
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!
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
can't imagine data processing without pandas,numpy but with for loops..
hello and thanks for ur hard work...wish you'd explained the codes alittle bit.
Explanation of theory was superb..
Sir, plz try to explain coding as well.
Overall good session.
Thank you for appreciating our efforts. We will definitely look into your suggestions. Do subscribe to our channel and stay connected with us. Cheers :)
Great video it helps a lot
best explanation i found on the internet till date
Great, it was magical! thanks
Too nice thnk u
Thanks ....got the concept
Super sir
realy nice. nice job
very good explaination
very good content and explanation. it will be good if you talk little slow. will be easy to understand.
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! :)
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?
Excellent video and superb explanation. Could you please share the source code?
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.
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.
Thanks a ton..Reallly good video :-)
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!
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 ?
Hi Soumya, for every element present in x, there will be four iterations.
Well explained!
Really helpful video.Thanks!!
Do u know how to do predictions on yearly data in python. Which method will be appropriate for this?
Thanks for appreciating our efforts! Time Series will be appropriate for this.
@@edurekaIN thanks
thank you
thanks for such a superb explanation
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..
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.
what a great explanation about KNN. I like your explanation..Really helpful to beginners . Thanks
Thank you so much. From where could I have the code?
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
Sir,
Your video is really informative....
I am extremely happy with this excellent presentation. Thank you.
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!
Ho..is it possible to get this code
it was supeb explanation
can we built gu interface in python for prediction
Hi Gagan! Yes, you can build a Graphic user interface with the help of Tkinter
@@edurekaIN okay. Thnku. But i am working on anaconda spyder. Can we built gui in spyder also for predicted system
Dear Edureka team
Also please provide a KNN algorithm in R session online video
Hey Airbornetroops, we will definitely look into your suggestions. Do subscribe and stay tuned to any updates on our channel. Cheers :)
If I got same distance then what should we do???
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).
how to draw the decision boundaries?
Refer to this link to resolve your query - stats.stackexchange.com/questions/370531/knn-decision-boundary
now how would I plot the data?
You can make use of seaborn functions to plot this data. For a complete Seaborn tutorial, you can follow the link: bit.ly/34u41mG
Can u plz provide me the data set
Hi Sagarika, kindly drop in your email id to help us assist you with the required source codes :)
How do we choose the optimum value of K
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.
How to optimize knn algorithm to get more accuracy?
Hey Gujrant, simplest solution is to use K-Fold Cross Validation or using the technique of bootstrapping. Hope this helps!
sir i request you to please provide us your mail id so that i could able to ask you some basic question regarding ML
Hey Amrita, please feel free to ask your queries over here and we will try our best to answer it for you. Cheers!
can we predict gender of human being based on height and weight using KNN classifier?
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.
dear edurka team i need this python code plz help me to provide
Please share your email id with us (it will not be published). We will forward the source code to your email address.
You said you will also implement KNN with Scikit Learn Library but you did not.
Hey Naresh, Thanks for the feedback. We will definitely look into your suggestion. Do subscribe, like and share to stay connected with us. Cheers!
How do we take k value randomly?
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!
how to take k value
Hey Mahesh, set k = n^(1/2).
What makes Knn algorithm slow? Value of K?
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!