SlideShare a Scribd company logo
KNN Algorithm Using R | Edureka
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
Agenda
32 41 5
Machine
Learning
What is KNN
Algorithm?
KNN Use Case Hands - On
KNN Algorithm
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
Introduction To Machine Learning
Machine learning is a subset of artificial intelligence (AI) which
provides machines the ability to learn automatically & improve from
experience without being explicitly programmed.
What Is Machine
Learning? Continuously
feed data
Machine learning is a subset of artificial intelligence (AI) which
provides machines the ability to learn automatically & improve from
experience without being explicitly programmed.
What Is Machine
Learning? Continuously
feed data
Predicted
output
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
Types Of Machine Learning
Supervised
Machine Learning
Supervised Machine Learning is a learning in which we teach or train
the machine using data which is well labelled.
Unsupervised learning is the training of machine using information
that is unlabelled and allowing the algorithm to act on that
information without guidance
Unsupervised
Machine Learning
Reinforcement
Machine Learning
Reinforcement Learning is a part of Machine learning where an agent is put
in an environment and he learns to behave in this environment by
performing certain actions and observing the rewards which it gets from
those actions.
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
What Is KNN Algorithm?
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
What Is KNN Algorithm?
K Nearest Neighbour is a Supervised Learning algorithm that classifies a new data point into
the target class, depending on the features of it’s neighbouring data points.
KNN Algorithm
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
Features Of KNN
Supervised learning
algorithm
Simple
Non-parametric
Lazy algorithm
Classification & regression algorithm
Based on feature similarity
No training step
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
KNN Use Case
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
Book Recommendation Using KNN
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
How KNN Algorithm Works?
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
How Does KNN Algorithm Work?
Problem Statement: Assign the new data point into one of the two clusters
Class A
Class B
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
How Does KNN Algorithm Work?
Class A
Class B
Choose the value of ‘k’, here k=3 and find the 3 nearest neighbours
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
How Does KNN Algorithm Work?
Here k=7, find the 7 nearest neighbours
Class A
Class B
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
How Does KNN Algorithm Work?
Assign the new data point into Class B since majority of it’s nearest neighbours are of type class B
Class A
Class B
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
Euclidian Distance
0
1
2
3
4
1 2 3 4 5
P1
P2
Point P1 = (1,4)
Point P2 = (5,1)
Euclidian distance =
Calculations
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
Demo
YouTube Video Link in the Description
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
Demo
Problem Statement: Study a bank credit dataset and make a decision about whether to approve the loan of
an applicant based on his profile
KNN algorithm
Approve loan Reject loan
DATA SCIENCE CERTIFICATION www.edureka.co/data-science
WebDriver vs. IDE vs. RC
➢ Data Warehouse is like a relational database designed for analytical needs.
➢ It functions on the basis of OLAP (Online Analytical Processing).
➢ It is a central location where consolidated data from multiple locations (databases) are stored.

More Related Content

PPTX
Machine Learning Tutorial | Machine Learning Basics | Machine Learning Algori...
PDF
Machine Learning In Python | Python Machine Learning Tutorial | Deep Learning...
ODP
NAIVE BAYES CLASSIFIER
PDF
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Tutori...
PDF
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
PDF
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
PPTX
Machine Learning using Support Vector Machine
PDF
Machine Learning Course | Edureka
Machine Learning Tutorial | Machine Learning Basics | Machine Learning Algori...
Machine Learning In Python | Python Machine Learning Tutorial | Deep Learning...
NAIVE BAYES CLASSIFIER
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Tutori...
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Linear Regression Algorithm | Linear Regression in Python | Machine Learning ...
Machine Learning using Support Vector Machine
Machine Learning Course | Edureka

What's hot (20)

PDF
Deep Learning Tutorial | Deep Learning Tutorial for Beginners | Neural Networ...
PDF
Deep Feed Forward Neural Networks and Regularization
PPTX
Linear regression with gradient descent
PPTX
Optimization/Gradient Descent
PDF
Naive Bayes
PPTX
Machine Learning and Real-World Applications
PPTX
Unsupervised learning (clustering)
PPTX
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
PPTX
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
PDF
K - Nearest neighbor ( KNN )
PPTX
Artificial Intelligence Course | AI Tutorial For Beginners | Artificial Intel...
PDF
Python Machine Learning Tutorial | Machine Learning Algorithms | Python Train...
PPTX
What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...
ODP
Machine Learning With Logistic Regression
PPTX
Deep Learning Applications | Deep Learning Applications In Real Life | Deep l...
PPTX
Deep Learning With Python | Deep Learning And Neural Networks | Deep Learning...
PDF
Introduction to Machine Learning Classifiers
PDF
Introduction to Generative Adversarial Networks (GANs)
PPTX
K Nearest Neighbor Algorithm
PPTX
Naive bayes
Deep Learning Tutorial | Deep Learning Tutorial for Beginners | Neural Networ...
Deep Feed Forward Neural Networks and Regularization
Linear regression with gradient descent
Optimization/Gradient Descent
Naive Bayes
Machine Learning and Real-World Applications
Unsupervised learning (clustering)
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
K - Nearest neighbor ( KNN )
Artificial Intelligence Course | AI Tutorial For Beginners | Artificial Intel...
Python Machine Learning Tutorial | Machine Learning Algorithms | Python Train...
What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...
Machine Learning With Logistic Regression
Deep Learning Applications | Deep Learning Applications In Real Life | Deep l...
Deep Learning With Python | Deep Learning And Neural Networks | Deep Learning...
Introduction to Machine Learning Classifiers
Introduction to Generative Adversarial Networks (GANs)
K Nearest Neighbor Algorithm
Naive bayes
Ad

Similar to KNN Algorithm Using R | Edureka (20)

PDF
Introduction to data mining and machine learning
PDF
tghteh ddh4eth rtnrtrgthgh12500123196.pdf
PPTX
NEAREST NEIGHBOUR CLUSTER ANALYSIS.pptx
PPTX
Statistical Machine Learning unit3 lecture notes
PDF
Supervised Machine Learning PPT by K. Adisesha
PDF
Natural Language Processing of applications.pdf
PPTX
KNN Classificationwithexplanation and examples.pptx
PPTX
KNN and steps to define knn and various properties.pptx
PPTX
MachineLearning.pptx
PPTX
K-Nearest Neighbor(KNN)
PPTX
K neareast neighbor algorithm presentation
PDF
KNN Algorithm using Python | How KNN Algorithm works | Python Data Science Tr...
PPTX
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
PPTX
KNN Classifier
PPTX
K Nearest Neighbor V1.0 Supervised Machine Learning Algorithm
PPTX
Machine Learning Unit 4 Semester 3 MSc IT Part 2 Mumbai University
PPTX
K-Nearest Neighbor Classifier
PPTX
K Nearest Neighbour (KNN) Alg.pptx fro machine learning
PPTX
Machine Learning.pptx
PPTX
artificial intelligence.pptx
Introduction to data mining and machine learning
tghteh ddh4eth rtnrtrgthgh12500123196.pdf
NEAREST NEIGHBOUR CLUSTER ANALYSIS.pptx
Statistical Machine Learning unit3 lecture notes
Supervised Machine Learning PPT by K. Adisesha
Natural Language Processing of applications.pdf
KNN Classificationwithexplanation and examples.pptx
KNN and steps to define knn and various properties.pptx
MachineLearning.pptx
K-Nearest Neighbor(KNN)
K neareast neighbor algorithm presentation
KNN Algorithm using Python | How KNN Algorithm works | Python Data Science Tr...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Classifier
K Nearest Neighbor V1.0 Supervised Machine Learning Algorithm
Machine Learning Unit 4 Semester 3 MSc IT Part 2 Mumbai University
K-Nearest Neighbor Classifier
K Nearest Neighbour (KNN) Alg.pptx fro machine learning
Machine Learning.pptx
artificial intelligence.pptx
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
PDF
Top 5 Trending Business Intelligence Tools | Edureka
PDF
Tableau Tutorial for Data Science | Edureka
PDF
Python Programming Tutorial | Edureka
PDF
Top 5 PMP Certifications | Edureka
PDF
Top Maven Interview Questions in 2020 | Edureka
PDF
Linux Mint Tutorial | Edureka
PDF
How to Deploy Java Web App in AWS| Edureka
PDF
Importance of Digital Marketing | Edureka
PDF
RPA in 2020 | Edureka
PDF
Email Notifications in Jenkins | Edureka
PDF
EA Algorithm in Machine Learning | Edureka
PDF
Cognitive AI Tutorial | Edureka
PDF
AWS Cloud Practitioner Tutorial | Edureka
PDF
Blue Prism Top Interview Questions | Edureka
PDF
Big Data on AWS Tutorial | Edureka
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
PDF
Kubernetes Installation on Ubuntu | Edureka
PDF
Introduction to DevOps | Edureka
What to learn during the 21 days Lockdown | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Tableau Tutorial for Data Science | Edureka
Python Programming Tutorial | Edureka
Top 5 PMP Certifications | Edureka
Top Maven Interview Questions in 2020 | Edureka
Linux Mint Tutorial | Edureka
How to Deploy Java Web App in AWS| Edureka
Importance of Digital Marketing | Edureka
RPA in 2020 | Edureka
Email Notifications in Jenkins | Edureka
EA Algorithm in Machine Learning | Edureka
Cognitive AI Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Blue Prism Top Interview Questions | Edureka
Big Data on AWS Tutorial | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Kubernetes Installation on Ubuntu | Edureka
Introduction to DevOps | Edureka

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Electronic commerce courselecture one. Pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
KodekX | Application Modernization Development
Programs and apps: productivity, graphics, security and other tools
Electronic commerce courselecture one. Pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation_ Review paper, used for researhc scholars
Chapter 3 Spatial Domain Image Processing.pdf
Empathic Computing: Creating Shared Understanding
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
sap open course for s4hana steps from ECC to s4
Diabetes mellitus diagnosis method based random forest with bat algorithm
KodekX | Application Modernization Development

KNN Algorithm Using R | Edureka

  • 2. DATA SCIENCE CERTIFICATION www.edureka.co/data-science Agenda 32 41 5 Machine Learning What is KNN Algorithm? KNN Use Case Hands - On KNN Algorithm
  • 3. DATA SCIENCE CERTIFICATION www.edureka.co/data-science Introduction To Machine Learning
  • 4. Machine learning is a subset of artificial intelligence (AI) which provides machines the ability to learn automatically & improve from experience without being explicitly programmed. What Is Machine Learning? Continuously feed data
  • 5. Machine learning is a subset of artificial intelligence (AI) which provides machines the ability to learn automatically & improve from experience without being explicitly programmed. What Is Machine Learning? Continuously feed data Predicted output
  • 6. DATA SCIENCE CERTIFICATION www.edureka.co/data-science Types Of Machine Learning
  • 7. Supervised Machine Learning Supervised Machine Learning is a learning in which we teach or train the machine using data which is well labelled.
  • 8. Unsupervised learning is the training of machine using information that is unlabelled and allowing the algorithm to act on that information without guidance Unsupervised Machine Learning
  • 9. Reinforcement Machine Learning Reinforcement Learning is a part of Machine learning where an agent is put in an environment and he learns to behave in this environment by performing certain actions and observing the rewards which it gets from those actions.
  • 10. DATA SCIENCE CERTIFICATION www.edureka.co/data-science What Is KNN Algorithm?
  • 11. DATA SCIENCE CERTIFICATION www.edureka.co/data-science What Is KNN Algorithm? K Nearest Neighbour is a Supervised Learning algorithm that classifies a new data point into the target class, depending on the features of it’s neighbouring data points. KNN Algorithm
  • 12. DATA SCIENCE CERTIFICATION www.edureka.co/data-science Features Of KNN Supervised learning algorithm Simple Non-parametric Lazy algorithm Classification & regression algorithm Based on feature similarity No training step
  • 13. DATA SCIENCE CERTIFICATION www.edureka.co/data-science KNN Use Case
  • 14. DATA SCIENCE CERTIFICATION www.edureka.co/data-science Book Recommendation Using KNN
  • 15. DATA SCIENCE CERTIFICATION www.edureka.co/data-science How KNN Algorithm Works?
  • 16. DATA SCIENCE CERTIFICATION www.edureka.co/data-science How Does KNN Algorithm Work? Problem Statement: Assign the new data point into one of the two clusters Class A Class B
  • 17. DATA SCIENCE CERTIFICATION www.edureka.co/data-science How Does KNN Algorithm Work? Class A Class B Choose the value of ‘k’, here k=3 and find the 3 nearest neighbours
  • 18. DATA SCIENCE CERTIFICATION www.edureka.co/data-science How Does KNN Algorithm Work? Here k=7, find the 7 nearest neighbours Class A Class B
  • 19. DATA SCIENCE CERTIFICATION www.edureka.co/data-science How Does KNN Algorithm Work? Assign the new data point into Class B since majority of it’s nearest neighbours are of type class B Class A Class B
  • 20. DATA SCIENCE CERTIFICATION www.edureka.co/data-science Euclidian Distance 0 1 2 3 4 1 2 3 4 5 P1 P2 Point P1 = (1,4) Point P2 = (5,1) Euclidian distance = Calculations
  • 21. DATA SCIENCE CERTIFICATION www.edureka.co/data-science Demo YouTube Video Link in the Description
  • 22. DATA SCIENCE CERTIFICATION www.edureka.co/data-science Demo Problem Statement: Study a bank credit dataset and make a decision about whether to approve the loan of an applicant based on his profile KNN algorithm Approve loan Reject loan
  • 23. DATA SCIENCE CERTIFICATION www.edureka.co/data-science WebDriver vs. IDE vs. RC ➢ Data Warehouse is like a relational database designed for analytical needs. ➢ It functions on the basis of OLAP (Online Analytical Processing). ➢ It is a central location where consolidated data from multiple locations (databases) are stored.