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

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 8. 06. 2024
  • đŸ”„AI & Machine Learning Bootcamp(US Only): www.simplilearn.com/ai-machin...
    đŸ”„Professional Certificate Course In AI And Machine Learning by IIT Kanpur (India Only): www.simplilearn.com/iitk-prof...
    đŸ”„ Purdue Post Graduate Program In AI And Machine Learning: www.simplilearn.com/pgp-ai-ma...
    đŸ”„AI Engineer Masters Program (Discount Code - YTBE15): www.simplilearn.com/masters-i...
    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?
    Dataset Link - drive.google.com/drive/folder...
    ✅Subscribe to our Channel to learn more about the top Technologies: bit.ly/2VT4WtH
    ⏩ Check out the Machine Learning tutorial videos: bit.ly/3fFR4f4
    You can also go through the slides here: goo.gl/XP6xcp
    #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

    👉 Learn More At: www.simplilearn.com/artificia...
    đŸ”„đŸ”„ Interested in Attending Live Classes? Call Us: IN - 18002127688 / US - +18445327688

Komentáƙe • 929

  • @SimplilearnOfficial
    @SimplilearnOfficial  Pƙed rokem +2

    đŸ”„AI & Machine Learning Bootcamp(US Only): www.simplilearn.com/ai-machine-learning-bootcamp?KNNInMLMachineLearning&Comments&
    đŸ”„Professional Certificate Course In AI And Machine Learning by IIT Kanpur (India Only): www.simplilearn.com/iitk-professional-certificate-course-ai-machine-learning?AugustTubebuddyExpPCPAIandML&Comments&
    đŸ”„ Purdue Post Graduate Program In AI And Machine Learning: www.simplilearn.com/pgp-ai-machine-learning-certification-training-course?KNNInMLMachineLearning&Comments&
    đŸ”„AI Engineer Masters Program (Discount Code - YTBE15): www.simplilearn.com/masters-in-artificial-intelligence?SCE-AIMasters&Comments&

  • @SimplilearnOfficial
    @SimplilearnOfficial  Pƙed 2 lety +14

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

    • @claytonjesus4635
      @claytonjesus4635 Pƙed 2 lety

      I guess im randomly asking but does any of you know of a trick to log back into an instagram account..?
      I somehow forgot the account password. I appreciate any help you can offer me

  • @KrisYT
    @KrisYT Pƙed 3 lety +5

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

  • @samsupertaco
    @samsupertaco Pƙed 2 lety +2

    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!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 2 lety

      Thank you for the appreciation. You can check our videos related to various technologies and subscribe to our channel to stay updated with all the trending technologies.

  • @sinchanar8715
    @sinchanar8715 Pƙed 3 lety +41

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

  • @lfreeordye7791
    @lfreeordye7791 Pƙed 2 lety +4

    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!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 2 lety

      WooHoo! We are so happy you love our videos. Please do keep checking back in. We put up new videos every week on all your favorite topics. Whenever you have the time, you must also check out our blog page @simplilearn.com and tell us what you think. Have a good day!

    • @ernestanonde3218
      @ernestanonde3218 Pƙed 2 lety

      you put it better than I did. I have been struggling to understand what KNN means. Had over 6 lecturers mentioning it in the class but it still sounded vague. But he just made my day with this video.

  • @aaronwilhelm8203
    @aaronwilhelm8203 Pƙed 5 lety

    This video really helped my overall understanding of KNN and refreshed my understanding of the euclidean distance formula. Subscribed!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hey Aaron, thank you for appreciating our work. We are glad to have helped. We are happy to receive a new subscriber and we hope you are loving our community. We put up new videos on all important topics, so stay tuned. Cheers!

  • @ayondebnath8145
    @ayondebnath8145 Pƙed 2 lety +1

    Thank you so much for such wonderful tutorial ! Can't express how grateful I am for this. Everything is very nicely explained.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 2 lety

      Hey, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @shambhavisadhashivam4123
    @shambhavisadhashivam4123 Pƙed 4 lety +7

    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)

  • @xunnygujjar2094
    @xunnygujjar2094 Pƙed 3 lety +3

    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.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 3 lety

      Thank you for the appreciation. You can check our videos related to various technologies and subscribe to our channel to stay updated with all the trending technologies.

  • @sovannoup662
    @sovannoup662 Pƙed 4 lety

    best tutorial of KNN i've ever watched. It helps me a lot

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety

      Glad you enjoyed our video! We have a ton more videos like this on our channel. We hope you will join our community!

  • @scotthofbauer5448
    @scotthofbauer5448 Pƙed 4 lety +2

    This is such a great tutorial! Thank you so much!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety

      We are glad you found our video helpful, Scott. Like and share our video with your peers and also do not forget to subscribe to our channel for not missing video updates. We will be coming up with more such videos. Cheers!

  • @shoroukelsebaie8487
    @shoroukelsebaie8487 Pƙed 4 lety +7

    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.

    • @11hamma
      @11hamma Pƙed 3 lety +2

      i know im late but anyways it occurs because string data cant be standaradized i.e. put into StandardScaler. comvert it to float value
      try doing this:
      df[column_name] = df[column_name].astype('float')
      (i didnt try it myself but it should hopefull solve the issue)

  • @raefmac7436
    @raefmac7436 Pƙed 2 lety +9

    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...

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 2 lety +1

      Keep learning with us .Stay connected with our channel and team :) . Do subscribe the channel for more updates : )

  • @ghafoury
    @ghafoury Pƙed 2 lety +2

    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 :)

  • @andriibilych4983
    @andriibilych4983 Pƙed 3 lety +1

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

  • @gideonyuval
    @gideonyuval Pƙed 2 lety +6

    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...

  • @amithnambiar9818
    @amithnambiar9818 Pƙed 2 lety +5

    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.

    • @josephwhite5563
      @josephwhite5563 Pƙed 2 lety

      true, the formula is normalisedX= (X-mean)/deviation

  • @vandankhambhata1280
    @vandankhambhata1280 Pƙed 3 lety +2

    Hey this is really an amazing video! I was looking for this type of video and to my luck i found this!!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 3 lety +1

      Hey Vandan, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @ernestanonde3218
    @ernestanonde3218 Pƙed 2 lety +2

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

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 2 lety

      We are glad you found our video helpful. Like and share our video with your peers and also do not forget to subscribe to our channel for not missing video updates. We will be coming up with more such videos. Cheers!

  • @roseb2105
    @roseb2105 Pƙed 5 lety +4

    whats a confusion matrix?

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety +2

      In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as an error matrix, is a specific table layout that allows visualization of the performance of an algorithm, typically a supervised learning one. Hope that helps!

    • @ZeeshanJamal-dm9jy
      @ZeeshanJamal-dm9jy Pƙed 3 lety

      If you're confused about confusion matrix, you should check out zero r and one r classifier.

  • @samratsengupta8881
    @samratsengupta8881 Pƙed 3 lety +1

    This was really good compared to others, thanks i'll keep looking for more. Cheers!

  • @ganeshsubramanian6217
    @ganeshsubramanian6217 Pƙed 2 lety +1

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

  • @abhishekpurohit3442
    @abhishekpurohit3442 Pƙed 4 lety

    Wonderful explaination of the code which many of the other channels lack in their videos. THank you so much for explaining each step...

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety

      Hey Abhishek, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @davidbenavides4107
    @davidbenavides4107 Pƙed 4 lety

    Wow, your way of explaining and your didactic examples and materials are simply awesome!!. You got a new subscriber. Thank you, and please keep posting your amazing work.

  • @msctube45
    @msctube45 Pƙed 3 lety +1

    Thank you for this illustrative and informative video. Excellent job explaining KNN and a practical real life Python application example.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 3 lety

      WooHoo! We are so happy you love our videos. Please do keep checking back in. We put up new videos every week on all your favorite topics. Whenever you have the time, you must also check out our blog page @simplilearn.com and tell us what you think. Have a good day!

  • @malteshkumar421
    @malteshkumar421 Pƙed 5 lety

    Such great tutorial, keep making such great video's. Thank you !!!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hey Maltesh, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @tejasb.8919
    @tejasb.8919 Pƙed 5 lety +1

    Thank you for sharing this in very A nice and clear explanation for the KNN Algorithm with use case.
    Appreciated !!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hey Tejas, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @556west
    @556west Pƙed 2 lety +1

    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!!

  • @giridharreddy5125
    @giridharreddy5125 Pƙed 4 lety

    Thank you so much for this video, your way of explanation is really great, i really admire it. Thank you very much again

  • @akintomiwaakinyemi3880
    @akintomiwaakinyemi3880 Pƙed rokem +2

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

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed rokem

      Thank you for choosing us as your learning partner. We are thrilled to hear that you enjoyed your experience with us! If you are looking to expand your knowledge further, we invite you to explore our other courses in the description box.

  • @anthonykeller5120
    @anthonykeller5120 Pƙed 2 lety +2

    I found this fascinating. Wish machine learning/data analysis was around when I was doing my CS masters degree. Lots of spare time to learn in retirement. Great video, and I loved the Python even more. I’ve always found the correct working code to be the true documentation.

  • @ShivaKrish333
    @ShivaKrish333 Pƙed 5 lety

    very brief explanation thank you so much for that.
    I have a doubt when you divide the dataset into train and test data sets with the class labels.
    we apply K-NN function on train data set with the class labels I mean scaling then after we use test data set to a prediction right but here we don't take test dataset class labels.
    is it right if not just let me know?

  • @yeanyean5248
    @yeanyean5248 Pƙed 4 lety +1

    Thanks for the video! simple yet detail explanation!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety

      Hey, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @inuzukaop583
    @inuzukaop583 Pƙed 2 lety

    Thank you for the explanation it was a great help... I have a little question though.. I have a dataset that contains some missings value and I want to replace those values usin the knn... And I was wondering if I should just separate them from the dataset and train the knn usin the rest of the dataset, and then predict their valuesor is there any other way (without separating the dataset)

  • @aleksanderkus5483
    @aleksanderkus5483 Pƙed 3 lety

    Amazing video, everything I expected was there, thank you.

  • @linhviet2568
    @linhviet2568 Pƙed 2 lety +1

    Amazing video. I'm learning data science and this helps a lot!

  • @MrFilmyBoy
    @MrFilmyBoy Pƙed 5 lety +2

    Hi there, thanks for your video. it helps me alot in studing ML. I have one doubt, Why do you choose only glucose, BloodPressure, skinthickness, insulin and BMI?

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hi Joshi, thanks for checking out our tutorial and tossing out your queries. Of course, there are a lot of factors affecting the actual result but we have chosen the most important and obvious factors for a clear understanding of the concepts used and to not confuse the audience with medical jargons. Thank you.

  • @07blue71
    @07blue71 Pƙed 5 lety

    Super useful and informative, thanks!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hey, thank you for watching our video. We appreciate the kind comment. Do subscribe and stay connected with us. Cheers :)

  • @shlokdoshi7162
    @shlokdoshi7162 Pƙed 2 lety +1

    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?

  • @MrPhantom441
    @MrPhantom441 Pƙed 3 lety

    If I preprocess my data using a standard scaler, how will I format my data when I'm doing real time predictions?

  • @truffboy1263
    @truffboy1263 Pƙed 5 lety +2

    Can i use k-nn if i have like 48 features? Or was it too much? If so, what type of ML method would you recommend for it?

  • @laguna8211
    @laguna8211 Pƙed 4 lety +2

    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!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety +1

      Glad you enjoyed our video! We have a ton more videos like this on our channel. We hope you will join our community!

  • @wenner12345
    @wenner12345 Pƙed 3 lety

    Great video!!! just one question: i didnt understand what part of the video was the 'k' you chose?

  • @ifeanyiokwuazu3225
    @ifeanyiokwuazu3225 Pƙed 3 lety

    This is really simple as the name of the channel suggests, thanks

  • @denisvoronov6571
    @denisvoronov6571 Pƙed 4 lety

    Brief and very clear! Thanks!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety

      Hey Denis, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @lakshmitejaswi7832
    @lakshmitejaswi7832 Pƙed 5 lety

    pls provide the data set
    cant we replace 0 directly with mean?
    diff b.w fit, transform ,fit_transform when to use which?
    why k should be even?

  • @LuisGonzalez-hy2kz
    @LuisGonzalez-hy2kz Pƙed 3 lety +2

    For someone that is just hoping into Data science, this video is absolutely magnificent and loved how you go step by step on data preparation and KNN algorithm. Is there any way that I might get the dataset? Congrats for the video.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 3 lety

      Hello Luis, thanks for viewing our tutorial. It would be helpful if you will provide your email ID to us so that we could send the requested dataset promptly. On the off chance that you need your email ID to be kept hidden from others, we can do that also. Hope that helps.

  • @adityagoel723
    @adityagoel723 Pƙed 5 lety

    Good video. Clearly explained all the concept and Diabetes example is neat! Thanks!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hey Aditya, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @redamichaeljemberu9102
    @redamichaeljemberu9102 Pƙed 4 lety

    Thank You ! Best explanation with a simplistic example. Can I ask how could we improve the efficiency of the model ??

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety

      Hi Redamichael,
      There are multiple methods to improve the accuracy of any model. Some of them are feature engineering, feature selection, algorithm tuning, and ensemble methods.

  • @Magmatic91
    @Magmatic91 Pƙed 3 lety +1

    Thank you for this great course. Very well explained. I subscribe :)

  • @Ajazahm
    @Ajazahm Pƙed 2 lety +1

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

  • @msriramtube
    @msriramtube Pƙed 5 lety

    Thanks! A simple but very good turorial!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hey Madhvapathi, thank you for appreciating our work. We are glad that you liked our video. Do subscribe and stay connected with us. Cheers :)

  • @nealabh007
    @nealabh007 Pƙed 6 lety

    Really helpful video, simple examples and explanation

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 6 lety

      Great that you liked the tutorial, Nealabh! If you agree that Machine Learning is a good career move, please refer to this, www.simplilearn.com/big-data-and-analytics/machine-learning-certification-training-course. Also, Subscribe to our channel by clicking on the bell icon for never missing another update. Cheers !

  • @reaper5377
    @reaper5377 Pƙed 3 lety +2

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

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 3 lety

      Hello, thank you for watching our video. We are glad that you liked our video. Do subscribe and stay connected with us. Cheers :)

  • @munazaramzan603
    @munazaramzan603 Pƙed 5 lety

    awesome Tutorial...Thank you soo much

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety +1

      Hi Munaza, we are glad you found our video helpful and awesome. Like and share our video with your peers and also do not forget to subscribe to our channel for not missing video updates. We will be coming up with more such videos. Cheers!

  • @earlpappi5754
    @earlpappi5754 Pƙed 3 lety +1

    hello, that's a great tutorial, thanks for the effort. I don't know if I missed it but I can't seem to find where you trained the model, or that step is not really important?!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 3 lety

      It is our pleasure! Check out :www.simplilearn.com/tutorials/machine-learning-tutorial/knn-in-python for more in-depth tutorials! Happy learning!

  • @kumarivandana3289
    @kumarivandana3289 Pƙed 4 lety

    Awesome explanation...thank you so much for the video

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety

      Hey Kumari, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @tasmiatabassumarony7919
    @tasmiatabassumarony7919 Pƙed 5 lety

    what to do if we have six datasets and how to merge them? and between the datasets, there are some similarities between them and not some new features were introduced too. can you give me any suggestions regarding this matter?

  • @jjoshua95
    @jjoshua95 Pƙed 4 lety

    For choosing k, we are taking sqrt(n). what if the data points are 1000 the sqrt(1000) approx 31. Allocating k=31 is too much for the resources. Any other suggestions on this?

  • @seano.7316
    @seano.7316 Pƙed 2 lety

    Is there any way we can see what impact independent variables have on dependent variables like in linear regression? For example, if we were looking at the price of a car with price being dependent and mpg being independent, we can find that for every unit increase in mpg, a car's price goes up by $100.
    Is there a similar way to find the coefficients from our KNN model like we can with models like linear regression?

  • @sudhilmishra
    @sudhilmishra Pƙed 3 lety +1

    Thank you for such great explanation !!!

  • @BRIJESHKUMAR-zq4rt
    @BRIJESHKUMAR-zq4rt Pƙed 3 lety +1

    Thanks a lot for explaining very clearly.

  • @mummakidstv
    @mummakidstv Pƙed 4 lety +1

    Thank you for the nice and crystal clear explanation. I have one doubt over here in choosing the K value for given dataset. how it come to 11 ?
    As you taught 'K' Value should be sqrt of data points given which are 768.

    • @binapatel2208
      @binapatel2208 Pƙed 4 lety

      you cannot train against your entire dataset. You need to reserve a subset for testing/verification.

  • @simanchalpatnaik2566
    @simanchalpatnaik2566 Pƙed 4 lety

    Nice tutorial. How you have selected the list item for zero_not_accepted? Why the "Age" column is not taken for the list item?

  • @williamsung6650
    @williamsung6650 Pƙed 5 lety

    Hi, Thank you for sharing the tutorial. After reading and watching instructions from different resources, I have a question regarding on making predictions. That is,
    How do I make the prediction when I have a new dataset with no info. in the outcome column?
    For example, from a logistic regression analysis, I know there is a coefficient value for each valid predictor. I can use those coefficients to predict new cases. But I don't understand how to implement KNN except I know that (from your video example), after feeding training data, I have 82% of accuracy on predicting test data.
    Thank you in advance.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hi William, thanks for checking out our tutorial. KNN works on the simple principle based on minimum distance from the query object to the training samples to determine the nearest neighbours (K), after which we predict the query object based on the majority of closest neighbours. Hope that helps.

  • @dianacarvalhomonteiro3347
    @dianacarvalhomonteiro3347 Pƙed 3 lety +1

    what an amazing video , thank you!

  • @latreill
    @latreill Pƙed 3 lety

    Thanks for the video! Would a k-NN classification be able to tell us which variable(s) (Glucose, Blood Pressure, Skin Thickness, etc.) is the best predictor for diabetes? If not, which type of analysis would you recommend to figure that out? (i.e., Glocuse has a stronger correlation with Diabetes than Skin Thickness)

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 3 lety +1

      "Hi John,
      To find the feature variables that are the best predictors, you need to perform a correlation analysis to check the correlation that exists between the variables."

  • @amortalbeing
    @amortalbeing Pƙed 5 lety

    That was awesome:) liked and subbed Thanks a lot :)

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hey, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @robbiedeegan3121
    @robbiedeegan3121 Pƙed 2 lety +1

    This is so amazing, thank you 😊

  • @khalilfall5018
    @khalilfall5018 Pƙed 5 lety

    Before replacing the zero's by the mean in the columns you can first test is there is NanN in the data, if there is not you dont need the first line in the for loop I guess,
    data[column]=data[column].replace(0,NanN).

    • @khalilfall5018
      @khalilfall5018 Pƙed 5 lety

      A simple command is: dataset.isnull().sum()

  • @tudorradu5848
    @tudorradu5848 Pƙed 3 měsĂ­ci +2

    Great tutorial. Thank you!

  • @hamzabenkhalil4569
    @hamzabenkhalil4569 Pƙed 4 lety

    Hi , how can we apply this algorithm to an image in order to do image segmentation.

  • @sudhanshunautiyal6765
    @sudhanshunautiyal6765 Pƙed 3 lety +2

    what fit() function do, as we know that we didn't train the Knn so why we are doing fit()

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 3 lety

      "Hi Sughanshu,
      The fit() method is used to train the model by passing the training parameters."

  • @vizdom
    @vizdom Pƙed 4 lety

    Kudos mate Wonderful Video!

  • @Hiyori___
    @Hiyori___ Pƙed 3 lety

    amazing video. I learned a lot and it was very clear and informative

  • @trinathsahu8939
    @trinathsahu8939 Pƙed 4 lety

    U used test data to calculate k value. But we r fitting the model using train data. So, is it correct to use test data instead of train data for k value calculation. Plssss suggest..thx in advance.

  • @Ebube_dee
    @Ebube_dee Pƙed 9 měsĂ­ci

    im having reshape errors when i run the standard scaler, how do i resolve it

  • @erinhwang217
    @erinhwang217 Pƙed 5 lety

    Examples here a great... I appreciate you

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hey Erin, we're glad you enjoyed this video! If you want to learn more, you can check out this playlist: czcams.com/video/ukzFI9rgwfU/video.html.
      And don't forget to like, share and subscribe to our channel! :)"

  • @Lovedaramusic
    @Lovedaramusic Pƙed 5 lety +1

    Why do we select only a sqrt(total number of training data) for casting votes?

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      That is the recommended approach to take the square root of the total number of rows. Hope that helps!

  • @gabiie9839
    @gabiie9839 Pƙed 5 lety +1

    Hi what if your dataset is all categorical how can we calculate the nearest neighbor ?

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      When the data is categorical then it is not very much recommended to use KNN as there are many other algorithms that would do the task easily. But, if you need to use KNN then you must convert all categories into numbers and assign inter-category distances.

  • @bencunningham6595
    @bencunningham6595 Pƙed 4 lety

    Hi, great video. After we have created the model, how do we use it to predict whether new patients would have diabetes or not? Is there some sort of execution code we need to run to load the new data and test it against the model you built?

  • @roseb2105
    @roseb2105 Pƙed 5 lety +1

    do we calculate Euclidean distance of each data point to the new (unclassified) data point to find which points are closest?

  • @omkars764
    @omkars764 Pƙed 4 lety +1

    omg thank you for explaining the code

  • @sravyav1954
    @sravyav1954 Pƙed 3 lety

    Thanks a lot for the video, its very helpful. I have a question on how KNN is effected by imbalanced data. It would be great if you could if you answer me.
    Thanks in advance.

  • @pranavramachandrula3440
    @pranavramachandrula3440 Pƙed 2 lety +1

    hey there is an error when i try to run this command
    Y_pred=knn.predict(X_test)
    Y_pred
    this is the error, Notfittederror

  • @anynamecanbeuse
    @anynamecanbeuse Pƙed 5 lety

    what parameters are going to be trained? it seems it's just a non parametric model.

  • @srinivasreddy6836
    @srinivasreddy6836 Pƙed 4 lety

    facing problem while doing replacing zeroes to mean...
    error is 'int' object is not subscriptable

  • @Smimax6699
    @Smimax6699 Pƙed 3 lety

    Is there a mistake at 7:54? It must be: (170-167)ÂČ-(57-54)ÂČ. in your formular, the last number is 51... the x value of d1 in the coordinate system
    is wrong? Im right?

  • @KamleshSharma-si2rq
    @KamleshSharma-si2rq Pƙed 5 lety

    one of the best tutorial ever,sir can you pls share the dataset...Thank you.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hello kamlesh, thanks for the kind comment. It would be helpful if you will provide your email ID to us so that we could send the requested dataset promptly. On the off chance that you need your email ID to be kept hidden from others, we can do that also. Hope that helps.

    • @KamleshSharma-si2rq
      @KamleshSharma-si2rq Pƙed 5 lety +1

      @@SimplilearnOfficial sure kamlesh9707@gmail.com...thank you so much..

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety +1

      Hi Kamlesh, thanks for watching our video. We have sent the requested dataset to your mail ID. Do subscribe, like and share to stay connected with us. Cheers :)

  • @xianchen4570
    @xianchen4570 Pƙed 2 lety +1

    What a gem!!! Very clear and logic. I just have a question of k (k=11). Why using the sqrt(len(X_test))-1, not the sqrt(len(X_train))-1. Thanks!!!!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 2 lety

      Keep learning with us .Stay connected with our channel and team :) . Do subscribe the channel for more updates : )

  • @TechGame98
    @TechGame98 Pƙed 4 lety

    Thanks a lot that's video is very useful my concept

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 4 lety

      Hey Abubakar, thank you for appreciating our work. We are glad to have helped. Do check out our other tutorial videos and subscribe to us to stay connected. Cheers :)

  • @debashishchoudhuri1023
    @debashishchoudhuri1023 Pƙed 3 lety +1

    UBER helpful - well set up and well explained - THANK U

  • @haroonsalimi6226
    @haroonsalimi6226 Pƙed 5 lety

    Awesome video, I followed it to classify the iris dataset (and achieved 100% accuracy). One question though. Shouldn't you scale the input data as one so you have the same min and max values for both the training and testing data?

  • @akihalilovic
    @akihalilovic Pƙed 4 lety

    Simple and efficient, thumbs up

  • @susanaayehkwakye5265
    @susanaayehkwakye5265 Pƙed 5 lety

    Helpful video, thank you. My question is, can the Euclidean distance method be used in the second example where we are predicting whether a patient has diabetes or not?

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hi Susana, we apologize for the late reply. The answer is "Yes". We can easily use Euclidean distance wherever your coordinates in two-dimensions. Hope that helps!

    • @susanaayehkwakye5265
      @susanaayehkwakye5265 Pƙed 5 lety

      @@SimplilearnOfficial yes it helped thank you

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      You are welcome!

  • @haribabusompalli4203
    @haribabusompalli4203 Pƙed 5 lety

    A clear explanation for the KNN Algorithm with use case. Could you please share the data set for the practice purpose.

    • @haribabusompalli4203
      @haribabusompalli4203 Pƙed 5 lety

      hari.sompalli0205@gmail.com this is my mail id. Thanks in Advance.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hi Hari, thanks for watching our video. We have sent the requested dataset to your mail ID. Also, Subscribe to our channel by clicking on the bell icon for never missing another update. Cheers!

    • @hjsblogger
      @hjsblogger Pƙed 5 lety

      Can you please email the dataset to himanshu.sheth@gmail.com Thanks in advance for the same

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hi Himanshu, thanks for checking out our tutorial. We have sent the requested dataset to your mail ID. Whenever you have the time, you must also check out our blog page @simplilearn.com and tell us what you think. Have a good day!

  • @HARIRAM-li9sr
    @HARIRAM-li9sr Pƙed 5 lety

    Can we use KNN for Multi-class classification? Or it is just used for binary classification?

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Hi Hari, thanks for checking out our tutorial. Yes, definitely KNN can be used in multi-class classification models. For example, the very common iris dataset where we classify three different labels can be done using KNN. If you have further queries, you can post in the comments section, we will clear your queries/doubts.

  • @Diogoscout
    @Diogoscout Pƙed 5 lety

    Thank you for the video! But sorry my ignorance, i have a question: after i train the model and predict the response and had obtained the scores. Can i use the classifier created to classify and find patterns in a new dataset without labels?

    • @aniketrane
      @aniketrane Pƙed 5 lety +1

      Yes Diago it can be used ... That's whole idea of creating the model or classifier. Practical application of such model would be that such model can be exposed on the websites that promote healthy leaving. Individuals would enter their attributes which would be fed to the model. The model can then evaluate and suggest if the individual is prone to diabetes or not.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Thanks for your valuable input!

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      No, a model is trained for a particular dataset.

  • @chakradharreddy6293
    @chakradharreddy6293 Pƙed 5 lety

    Great video. Thanks.

    • @SimplilearnOfficial
      @SimplilearnOfficial  Pƙed 5 lety

      Thanks, Chakradhar :) Like and share our video with your peers and also do not forget to subscribe to our channel for not missing video updates. We will be coming up with more such videos. Cheers!