370 likes | 1.37k Views
** Python for Data Science: https://www.edureka.co/python ** <br>This Edureka tutorial 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 tutorial includes: <br><br>1. What is KNN Algorithm? <br>2. Industrial Use case of KNN Algorithm <br>3. How things are predicted using KNN Algorithm <br>4. How to choose the value of K? <br>5. KNN Algorithm Using Python <br>6. Implementation of KNN Algorithm from scratch <br><br>Check out our playlist: http://bit.ly/2taym8X
E N D
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
KNN Algorithm Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Agenda for Today’s Session ▪ What is KNN Algorithm? ▪ Industrial Use case of KNN Algorithm ▪ How things are predicted using KNN Algorithm ▪ How to choose the value of K? ▪ KNN Algorithm Using Python ▪ Implementation of KNN Algorithm from scratch ▪ Compare the built model using scikit learn Copyright © 2017, edureka and/or its affiliates. All rights reserved.
“K Nearest Neighbour is a simple algorithm that stores all the available cases and classifies the new data or What is KNN Algorithm? case based on a similarity measure.”
K = Number of Nearest Neighbors What is K in KNN Algorithm?
Industrial Application of KNN Algorithm Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Industrial Application of KNN Algorithm Copyright © 2018, edureka and/or its affiliates. All rights reserved.
How does a KNN Algorithm work? CLASS A CLASS B
How does a KNN Algorithm work? CLASS A CLASS B
How does a KNN Algorithm work? CLASS A CLASS B K= 3
How does a KNN Algorithm work? CLASS A CLASS B K= 6
How to choose the value of K
Euclidean Distance How things are predicted using KNN Algorithm?
Manhattan Distance How things are predicted using KNN Algorithm?
Manhattan Distance vs Euclidean Distance How things are predicted using KNN Algorithm?
Why KNN Algorithm is a ?
Let’s learn to DEMO code Copyright © 2017, edureka and/or its affiliates. All rights reserved. © MadeByShape Ltd. Web Design Manchester 2018. All Rights Reserved.
KNN: Step by Step Accuracy Response Generate a response from a set of data instance Summarizing the accuracy of predictions. Neighbors Locate k most similar data instances Main Tie it all together Handle Data Open the dataset from CSV and split into test/train datasets. Similarity Calculate the distance between two data instances Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Copyright © 2017, edureka and/or its affiliates. All rights reserved.