KNN Algorithm In Machine Learning | KNN Algorithm Using Python | K Nearest Neighbor | Simplilearn

preview_player
Показать описание

This KNN Algorithm in Machine Learningtutorial will help you understand what is KNN, why do we need KNN, and how KNN algorithm works using Python. You will learn how do we choose the factor 'K', when do we use KNN, with proper hands on demonstration to predict whether a person will have diabetes or not, using the KNN algorithm.

Below topics are explained in this K-Nearest Neighbor Algorithm (KNN Algorithm) tutorial:
00:00 Introduction to KNN(K Nearest Neighbor)
00:57 Why do we need KNN?
02:33 What is KNN?
03:51 How do we choose the factor 'K'?
05:46 When do we use KNN?
06:42 How does the KNN algorithm work?
09:19 Use case - Predict whether a person will have diabetes or not?

#KNNAlgorithmInMachineLearning #KNNAlgorithm #KNN #KNearestNeighbor #KNNMachineLearning #KNNAlgorithmPython #KNearestNegighborMachineLearning #MachineLearningAlgorithm #MachineLearning #Simplilearn

When Do We Use the KNN Algorithm?
The KNN algorithm is used in the following scenarios:
✅Data is labeled
✅Data is noise-free
✅Dataset is small, as KNN is a lazy learner

Pros and Cons of Using KNN
✅Pros: Since the KNN algorithm requires no training before making predictions, new data can be added seamlessly, which will not impact the accuracy of the algorithm.
KNN is very easy to implement. There are only two parameters required to implement KNN—the value of K and the distance function (e.g. Euclidean, Manhattan, etc.)
✅Cons: The KNN algorithm does not work well with large datasets. The cost of calculating the distance between the new point and each existing point is huge, which degrades performance.
Feature scaling (standardization and normalization) is required before applying the KNN algorithm to any dataset. Otherwise, KNN may generate wrong predictions.

➡️ About Post Graduate Program In AI And Machine Learning

This AI ML course is designed to enhance your career in AI and ML by demystifying concepts like machine learning, deep learning, NLP, computer vision, reinforcement learning, and more. You'll also have access to 4 live sessions, led by industry experts, covering the latest advancements in AI such as generative modeling, ChatGPT, OpenAI, and chatbots.

✅ Key Features

- Post Graduate Program certificate and Alumni Association membership
- Exclusive hackathons and Ask me Anything sessions by IBM
- 3 Capstones and 25+ Projects with industry data sets from Twitter, Uber, Mercedes Benz, and many more
- Master Classes delivered by Purdue faculty and IBM experts
- Simplilearn's JobAssist helps you get noticed by top hiring companies
- Gain access to 4 live online sessions on latest AI trends such as ChatGPT, generative AI, explainable AI, and more
- Learn about the applications of ChatGPT, OpenAI, Dall-E, Midjourney & other prominent tools

✅ Skills Covered

- ChatGPT
- Generative AI
- Explainable AI
- Generative Modeling
- Statistics
- Python
- Supervised Learning
- Unsupervised Learning
- NLP
- Neural Networks
- Computer Vision
- And Many More…

🔥🔥 Interested in Attending Live Classes? Call Us: IN - 18002127688 / US - +18445327688
Рекомендации по теме
Комментарии
Автор

My professor took 1 hour to clear the basic concepts of KNN but I was unable to understand. Thanks for clearing my concepts in just under 15 minutes. Thanks a lot. Really appreciated. I am going to subscribe your channel. Thanks once again.

xunnygujjar
Автор

I've been trying to understand this for weeks and you've summed it up in the first 2 minutes. Light bulb moment!

KrisYT
Автор

These tutorials are easy to understand and informative compared to other videos😌Thanks:)

sinchanar
Автор

Incredible video. I used it when I first heard of KNN to better understand it, and just used it to create my first model. You all are the best!

samsupertaco
Автор

Great video, up until the point where you skipped the part where you show how to train the algorithm. One could argue thats the most important part...

raefmac
Автор

This is an amazing video! I am trying to help my niece and have never read anything about KNN in my life but the way this video explains it is simply awesome! So thankful to you for creating this video as it would help thousands of students and those family members that want to help them learn properly. Do not understand why some professors can't seem to explain it so simply as you have! God bless you man!

lfreeordye
Автор

Best data science video ever. so detailed and explanatory. very good for beginners. Please keep making detailed videos like this

ernestanonde
Автор

I really really love how you broke down the topic and able to pass across all valuable information in a short while. Thank you

akintomiwaakinyemi
Автор

We hope you enjoyed watching our video. The link for the dataset used in the video is provided in the description. Thanks!

SimplilearnOfficial
Автор

Thank you for sharing this video it was very clear in detailed manner with example.
But I have a doubt in whether I to should take squareroot of n (n = Sum of Output of Distance Function) for calculating K.
5:11 (Choosing K)
8:55 (Choosing K=3)

shambhavisadhashivam
Автор

Many thanks team, this leaa than 30mins clip saved me a couple of days to learn similar thing from some books and articles. Fantastic job :)

ghafoury
Автор

My uni teacher made knn sucha scary thing to me... thanks God i found this vid...i m in love with knn now

Ajazahm
Автор

20:32 Correction - standard scaler does not restrict the range of data between -1 to +1 . It converts the data to a mean of 0 and standard deviation of 1 . So if u take the mean of a standardised column ul find it equals 0. It basically skews the data to a smaller range and makes it comparable with other variables with different magnitudes which otherwise would not have been comparable. Min-max scaler (normalisation) restricts the data between 0 to +1.

amithnambiar
Автор

Thanks alot that's very helpful, but when trying to use StandardScaler an error occurs
"ValueError: could not convert string to float"
i can't solve it, ahat shall i do ?
thanks in advance.

shoroukelsebaie
Автор

Thank you very much for this tutorial, it has been very clear, it has helped me a lot for my first Machine Learning model. Awesome!!

west
Автор

I'm totally new to any machine learning or programming stuff, and tbh I was super scared about learning -'K-NN algorithm' because the word 'algorithm' already sounded scary enough. However, your analogy of "Cats or dogs" and "claws and ears" REALLY MADE A LOT OF SENSE! If I have to lecture my own class about machine learning someday for other beginners, I think your "cat and dog" analogy of explanation cannot be more simpler. Thanks for the great video!

laguna
Автор

Thanks for a *fantastic* video!!! may I ask - when determining K, why do you do the sqrt of y_test, rather than y_train (or x_train, which is the same length). In the video, it looks like you intended to do that, then for some reason - changed it...

gideonyuval
Автор

Finally ! easiest video i found😅.Thanks simplilearn!!!

reaper
Автор

One of the best explanations I have come across, thank you so much!

ganeshsubramanian
Автор

This is the best explanation I have seen so far. Thank you.

andriibilych