KNN Algorithm using Python | How KNN Algorithm works | Python Data Science Training | Edureka
Vložit
- čas přidán 10. 07. 2018
- ** Python for Data Science: www.edureka.co/data-science-p... **
This Edureka video on KNN Algorithm will help you to build your base by covering the theoretical, mathematical and implementation part of the KNN algorithm in Python. Topics covered under this video includes:
1. What is KNN Algorithm?
2. Industrial Use case of KNN Algorithm
3. How things are predicted using KNN Algorithm
4. How to choose the value of K?
5. KNN Algorithm Using Python
6. Implementation of KNN Algorithm from scratch
Check out our playlist for more videos: bit.ly/2taym8X
Subscribe to our channel to get video updates. Hit the subscribe button above.
#KNNAlgorithm #MachineLearningUsingPython #MachineLearningTraining
How it Works?
1. This is a 5 Week Instructor led Online Course,40 hours of assignment and 20 hours of project work
2. We have a 24x7 One-on-One LIVE Technical Support to help you with any problems you might face or any clarifications you may require during the course.
3. At the end of the training you will be working on a real time project for which we will provide you a Grade and a Verifiable Certificate!
- - - - - - - - - - - - - - - - -
About the Course
Edureka’s Machine Learning Course using Python is designed to make you grab the concepts of Machine Learning. The Machine Learning training will provide deep understanding of Machine Learning and its mechanism. As a Data Scientist, you will be learning the importance of Machine Learning and its implementation in python programming language. Furthermore, you will be taught Reinforcement Learning which in turn is an important aspect of Artificial Intelligence. You will be able to automate real life scenarios using Machine Learning Algorithms. Towards the end of the course, we will be discussing various practical use cases of Machine Learning in python programming language to enhance your learning experience.
After completing this Machine Learning Certification Training using Python, you should be able to:
Gain insight into the 'Roles' played by a Machine Learning Engineer
Automate data analysis using python
Describe Machine Learning
Work with real-time data
Learn tools and techniques for predictive modeling
Discuss Machine Learning algorithms and their implementation
Validate Machine Learning algorithms
Explain Time Series and it’s related concepts
Gain expertise to handle business in future, living the present
- - - - - - - - - - - - - - - - - - -
Why learn Machine Learning with Python?
Data Science is a set of techniques that enables the computers to learn the desired behavior from data without explicitly being programmed. It employs techniques and theories drawn from many fields within the broad areas of mathematics, statistics, information science, and computer science. This course exposes you to different classes of machine learning algorithms like supervised, unsupervised and reinforcement algorithms. This course imparts you the necessary skills like data pre-processing, dimensional reduction, model evaluation and also exposes you to different machine learning algorithms like regression, clustering, decision trees, random forest, Naive Bayes and Q-Learning.
For more information, Please write back to us at sales@edureka.co or call us at IND: 9606058406 / US: 18338555775 (toll free).
Instagram: / edureka_learning
Facebook: / edurekain
Twitter: / edurekain
LinkedIn: / edureka
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.
Great, it was magical! thanks
best explanation i found on the internet till date
Thanks ....got the concept
thanks for such a superb explanation
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 :)
Excellent video and superb explanation. Could you please share the source code?
Well explained!
Great video it helps a lot
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!
very good explaination
realy nice. nice job
Too nice thnk u
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?
Ho..is it possible to get this code
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
what a great explanation about KNN. I like your explanation..Really helpful to beginners . Thanks
thank you
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.
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! :)
Super sir
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.
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!
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 :)
it was supeb explanation
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,
Your video is really informative....
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.
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.
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
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!
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
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
how to draw the decision boundaries?
Refer to this link to resolve your query - stats.stackexchange.com/questions/370531/knn-decision-boundary
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.
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 :)
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).
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!
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!
how to take k value
Hey Mahesh, set k = n^(1/2).