SlideShare a Scribd company logo
KNN ALGORITHM
KNN.pdf k nearest neghnor classifier in machine
KNN.pdf k nearest neghnor classifier in machine
Example for Classification - Whether tissue is good? (3,7)
x y Class
7 7 Bad
7 4 Bad
3 4 Good
1 4 Good
(7,7) |7-3| + |7-7| = 0 Bad
(7,4) |7-3| + |4-7| = 7 Bad
(3,4) |3-3| + |4-7| = 3 Good
(1,4) |1-3| +|4-7| = 5 Good
KNN.pdf k nearest neghnor classifier in machine
Basic Idea
● k-NN classification rule is to assign to a test sample
the majority category label of its k nearest training
samples
● In practice, k is usually chosen to be odd, so as to
avoid ties
● The k = 1 rule is generally called the nearest-neighbor
classification rule
KNN.pdf k nearest neghnor classifier in machine
Steps
Key points
○ K-NN is a non-parametric algorithm, which means it does not make any assumption on
underlying data.
○ It is also called a lazy learner algorithm because it does not learn from the training set
immediately instead it stores the dataset and at the time of classification, it performs
an action on the dataset.
○ KNN algorithm at the training phase just stores the dataset and when it gets new data,
then it classifies that data into a category that is much similar to the new data.
KNN.pdf k nearest neghnor classifier in machine
KNN.pdf k nearest neghnor classifier in machine
Thanks

More Related Content

PPTX
KNN Classifier
PPTX
KNN Classificationwithexplanation and examples.pptx
PPTX
K neareast neighbor algorithm presentation
PPTX
PPTX
K-Nearest Neighbor Classifier
PPTX
KNN and steps to define knn and various properties.pptx
PPTX
K Nearest Neighbour (KNN) Alg.pptx fro machine learning
PDF
tghteh ddh4eth rtnrtrgthgh12500123196.pdf
KNN Classifier
KNN Classificationwithexplanation and examples.pptx
K neareast neighbor algorithm presentation
K-Nearest Neighbor Classifier
KNN and steps to define knn and various properties.pptx
K Nearest Neighbour (KNN) Alg.pptx fro machine learning
tghteh ddh4eth rtnrtrgthgh12500123196.pdf

Similar to KNN.pdf k nearest neghnor classifier in machine (20)

PPTX
Knn Algorithm presentation
PPTX
KNN.pptx
PPTX
Knn demonstration
PPTX
K-Nearest Neighbor(KNN)
PDF
Natural Language Processing of applications.pdf
PDF
Knn algorithym execution - lab 9 ppt.pdf
PDF
Lecture03 - K-Nearest-Neighbor Machine learning
PPTX
Statistical Machine Learning unit3 lecture notes
PPTX
K- Nearest Neighbor Approach
PPTX
K- Nearest Neighbour Algorithm.pptx
PDF
k-nearest neighbour Machine Learning.pdf
PDF
K nearest neighbor algorithm
PDF
Machine Learning Algorithm - KNN
PPTX
K Nearest Neighbor Algorithm
PPTX
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
PDF
Chapter 05 k nn
PPTX
W5_CLASSIFICATION.pptxW5_CLASSIFICATION.pptx
PPTX
k-nearest neighbour Machine Learning.pptx
PPTX
Nearest neighbour algorithm
PDF
Training machine learning knn 2017
Knn Algorithm presentation
KNN.pptx
Knn demonstration
K-Nearest Neighbor(KNN)
Natural Language Processing of applications.pdf
Knn algorithym execution - lab 9 ppt.pdf
Lecture03 - K-Nearest-Neighbor Machine learning
Statistical Machine Learning unit3 lecture notes
K- Nearest Neighbor Approach
K- Nearest Neighbour Algorithm.pptx
k-nearest neighbour Machine Learning.pdf
K nearest neighbor algorithm
Machine Learning Algorithm - KNN
K Nearest Neighbor Algorithm
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
Chapter 05 k nn
W5_CLASSIFICATION.pptxW5_CLASSIFICATION.pptx
k-nearest neighbour Machine Learning.pptx
Nearest neighbour algorithm
Training machine learning knn 2017
Ad

More from BalamuruganV28 (6)

PDF
Final DBMS Manual (2).pdf final lab manual
PDF
Student manual CSBS (2).pdf for operating systems lab
DOCX
karthi batch.docx project documentation
PDF
CS 3251 Programming in c all unit notes pdf
DOCX
Object Oriented Programming All Unit Notes
PPTX
CS 3491 Artificial Intelligence and Machine Learning Unit I Problem Solving
Final DBMS Manual (2).pdf final lab manual
Student manual CSBS (2).pdf for operating systems lab
karthi batch.docx project documentation
CS 3251 Programming in c all unit notes pdf
Object Oriented Programming All Unit Notes
CS 3491 Artificial Intelligence and Machine Learning Unit I Problem Solving
Ad

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
additive manufacturing of ss316l using mig welding
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Well-logging-methods_new................
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
PPT on Performance Review to get promotions
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPT
Mechanical Engineering MATERIALS Selection
DOCX
573137875-Attendance-Management-System-original
PPTX
Current and future trends in Computer Vision.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
OOP with Java - Java Introduction (Basics)
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
UNIT 4 Total Quality Management .pptx
additive manufacturing of ss316l using mig welding
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Embodied AI: Ushering in the Next Era of Intelligent Systems
Well-logging-methods_new................
CH1 Production IntroductoryConcepts.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPT on Performance Review to get promotions
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Mechanical Engineering MATERIALS Selection
573137875-Attendance-Management-System-original
Current and future trends in Computer Vision.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS

KNN.pdf k nearest neghnor classifier in machine

  • 4. Example for Classification - Whether tissue is good? (3,7) x y Class 7 7 Bad 7 4 Bad 3 4 Good 1 4 Good (7,7) |7-3| + |7-7| = 0 Bad (7,4) |7-3| + |4-7| = 7 Bad (3,4) |3-3| + |4-7| = 3 Good (1,4) |1-3| +|4-7| = 5 Good
  • 6. Basic Idea ● k-NN classification rule is to assign to a test sample the majority category label of its k nearest training samples ● In practice, k is usually chosen to be odd, so as to avoid ties ● The k = 1 rule is generally called the nearest-neighbor classification rule
  • 9. Key points ○ K-NN is a non-parametric algorithm, which means it does not make any assumption on underlying data. ○ It is also called a lazy learner algorithm because it does not learn from the training set immediately instead it stores the dataset and at the time of classification, it performs an action on the dataset. ○ KNN algorithm at the training phase just stores the dataset and when it gets new data, then it classifies that data into a category that is much similar to the new data.