SlideShare a Scribd company logo
1 of 9
K-NEAREAST NEIGHBOR
ALGORITHM
PRESENTATION
INSTRUCTOR NAME- SIR ALI SHIRAZ
GROUP MEMBER
ABDUL WASAY – BB-6474
ARSALAN AHMED KHAN – BB-6490
* Contents
1. Introduction
2.Why we need to use K-NN Algorithm
3. How does K-NN Algorithm works
4. How to select K value in K-NN Algorithm
5. Advantages and Disadvantages of K-NN Algorithm
*INTRODUCTION
 K-Nearest Neighbor is one of the simplest Machine Learning algorithms.
 K-NN algorithm assumes the similarity between the new case/data and available cases.
 K-NN algorithm stores all the available data and classifies a new data point based on the
similarity.
 K-NN algorithm can be used for Regression as well as for Classification
 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
 K-NN algorithm at the training phase just stores the dataset and when it gets new data.
*Example:
• Suppose, we have an image of a creature that looks similar to a cat and dog, but we want to
know either it is a cat or dog. So, for this identification, we can use the KNN algorithm, as it
works on a similarity measure. Our KNN model will find the similar features of the new data
set to the cats and dogs’ images and based on the most similar features it will put it in either
cat or dog category.
* Why do we need a K-NN Algorithm?
Suppose there are two categories, i.e., Category A and Category B, and we have a new data point x1, so
this data point will lie in which of these categories. To solve this type of problem, we need a K-NN
algorithm. With the help of K-NN, we can easily identify the category or class of a particular dataset.
Consider the below diagram:
*How does K-NN work?
• The K-NN working can be explained on the basis of the below algorithm:
• Step-1: Select the number K of the neighbors
• Step-2: Calculate the Euclidean distance of K number of neighbors
• Step-3: Take the K nearest neighbors as per the calculated Euclidean distance.
• Step-4: Among these k neighbors, count the number of the data points in each category.
• Step-5: Assign the new data points to that category for which the number of the neighbor is
maximum.
• Step-6: Our model is ready.
*How to select the value of K in the K-NN Algorithm?
• There is no particular way to
determine the best value for "K", so
we need to try some values to find
the best out of them. The most
preferred value for K is 5.
• A very low value for K such as K=1 or
K=2, can be noisy and lead to the
effects of outliers in the model.
• Large values for K are good, but it
may find some difficulties.
Advantages of K-NN Algorithm:
It is simple to implement.
It is lazy learner, so therefore required no training
It can be more effective if the training data is large.
New data can be added seamlessly.
Disadvantages of KNN Algorithm:
Always needs to determine the value of K which may be complex some time.
The computation cost is high because of calculating the distance between the data
points for all the training samples.
THANKYOU!
ANY QUESTIONS?

More Related Content

What's hot

I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AIvikas dhakane
 
9 big o-notation
9 big o-notation9 big o-notation
9 big o-notationirdginfo
 
You Used To Inject Me In Your Constructor
 You Used To Inject Me In Your Constructor You Used To Inject Me In Your Constructor
You Used To Inject Me In Your ConstructorVeronica Lillie
 
Data structures and Big O notation
Data structures and Big O notationData structures and Big O notation
Data structures and Big O notationMuthiah Abbhirami
 
Semantic scaffolds for pseudocode to-code generation (2020)
Semantic scaffolds for pseudocode to-code generation (2020)Semantic scaffolds for pseudocode to-code generation (2020)
Semantic scaffolds for pseudocode to-code generation (2020)Minhazul Arefin
 
I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...
I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...
I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...vikas dhakane
 
SocNL: Bayesian Label Propagation with Confidence
SocNL: Bayesian Label Propagation with ConfidenceSocNL: Bayesian Label Propagation with Confidence
SocNL: Bayesian Label Propagation with ConfidenceYuto Yamaguchi
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...vikas dhakane
 
CS106 Lab 5 - Switch case
CS106 Lab 5 - Switch caseCS106 Lab 5 - Switch case
CS106 Lab 5 - Switch caseNada Kamel
 
Ranking using pairwise preferences
Ranking using pairwise preferencesRanking using pairwise preferences
Ranking using pairwise preferencesSweta Sharma
 
TD2-JS-functions
TD2-JS-functionsTD2-JS-functions
TD2-JS-functionsLilia Sfaxi
 
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.Andrea Angella
 

What's hot (20)

I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
Lab no.06
Lab no.06Lab no.06
Lab no.06
 
Complexity
ComplexityComplexity
Complexity
 
Union find
Union findUnion find
Union find
 
9 big o-notation
9 big o-notation9 big o-notation
9 big o-notation
 
You Used To Inject Me In Your Constructor
 You Used To Inject Me In Your Constructor You Used To Inject Me In Your Constructor
You Used To Inject Me In Your Constructor
 
Data structures and Big O notation
Data structures and Big O notationData structures and Big O notation
Data structures and Big O notation
 
Semantic scaffolds for pseudocode to-code generation (2020)
Semantic scaffolds for pseudocode to-code generation (2020)Semantic scaffolds for pseudocode to-code generation (2020)
Semantic scaffolds for pseudocode to-code generation (2020)
 
L7
L7L7
L7
 
Fundamental of Algorithms
Fundamental of Algorithms Fundamental of Algorithms
Fundamental of Algorithms
 
NMF with python
NMF with pythonNMF with python
NMF with python
 
15 unionfind
15 unionfind15 unionfind
15 unionfind
 
I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...
I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...
I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...
 
SocNL: Bayesian Label Propagation with Confidence
SocNL: Bayesian Label Propagation with ConfidenceSocNL: Bayesian Label Propagation with Confidence
SocNL: Bayesian Label Propagation with Confidence
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
 
CS106 Lab 5 - Switch case
CS106 Lab 5 - Switch caseCS106 Lab 5 - Switch case
CS106 Lab 5 - Switch case
 
Ranking using pairwise preferences
Ranking using pairwise preferencesRanking using pairwise preferences
Ranking using pairwise preferences
 
Dynamically updated parallel k-NN
Dynamically updated parallel k-NNDynamically updated parallel k-NN
Dynamically updated parallel k-NN
 
TD2-JS-functions
TD2-JS-functionsTD2-JS-functions
TD2-JS-functions
 
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
 

Similar to K neareast neighbor algorithm presentation

MachineLearning.pptx
MachineLearning.pptxMachineLearning.pptx
MachineLearning.pptxBangtangurl
 
Knn Algorithm presentation
Knn Algorithm presentationKnn Algorithm presentation
Knn Algorithm presentationRishavSharma112
 
Master defense presentation 2019 04_18_rev2
Master defense presentation 2019 04_18_rev2Master defense presentation 2019 04_18_rev2
Master defense presentation 2019 04_18_rev2Hyun Wong Choi
 
Training machine learning knn 2017
Training machine learning knn 2017Training machine learning knn 2017
Training machine learning knn 2017Iwan Sofana
 
KNN Algorithm using C++
KNN Algorithm using C++KNN Algorithm using C++
KNN Algorithm using C++Afraz Khan
 
Machine learning clustering
Machine learning clusteringMachine learning clustering
Machine learning clusteringNadeem Oozeer
 
K-Means Clustering Algorithm.pptx
K-Means Clustering Algorithm.pptxK-Means Clustering Algorithm.pptx
K-Means Clustering Algorithm.pptxJebaRaj26
 
Presentation Template__TY_AIML_IE2_Project (1).pptx
Presentation Template__TY_AIML_IE2_Project (1).pptxPresentation Template__TY_AIML_IE2_Project (1).pptx
Presentation Template__TY_AIML_IE2_Project (1).pptxSYETB202RandhirBhosa
 
K-Means Algorithm Implementation In python
K-Means Algorithm Implementation In pythonK-Means Algorithm Implementation In python
K-Means Algorithm Implementation In pythonAfzal Ahmad
 
Fake currency detection using knn algorithm.pptx
Fake currency detection using knn algorithm.pptxFake currency detection using knn algorithm.pptx
Fake currency detection using knn algorithm.pptxKajalJaswal3
 
Csci101 lect10 algorithms_iii
Csci101 lect10 algorithms_iiiCsci101 lect10 algorithms_iii
Csci101 lect10 algorithms_iiiElsayed Hemayed
 

Similar to K neareast neighbor algorithm presentation (20)

MachineLearning.pptx
MachineLearning.pptxMachineLearning.pptx
MachineLearning.pptx
 
K-Nearest Neighbor(KNN)
K-Nearest Neighbor(KNN)K-Nearest Neighbor(KNN)
K-Nearest Neighbor(KNN)
 
Knn Algorithm presentation
Knn Algorithm presentationKnn Algorithm presentation
Knn Algorithm presentation
 
Master defense presentation 2019 04_18_rev2
Master defense presentation 2019 04_18_rev2Master defense presentation 2019 04_18_rev2
Master defense presentation 2019 04_18_rev2
 
Training machine learning knn 2017
Training machine learning knn 2017Training machine learning knn 2017
Training machine learning knn 2017
 
KNN.pptx
KNN.pptxKNN.pptx
KNN.pptx
 
KNN Algorithm using C++
KNN Algorithm using C++KNN Algorithm using C++
KNN Algorithm using C++
 
Machine learning clustering
Machine learning clusteringMachine learning clustering
Machine learning clustering
 
DAA Notes.pdf
DAA Notes.pdfDAA Notes.pdf
DAA Notes.pdf
 
CS8080_IRT_UNIT - III T6 K-NN CLASSIFIER.pdf
CS8080_IRT_UNIT - III T6 K-NN CLASSIFIER.pdfCS8080_IRT_UNIT - III T6 K-NN CLASSIFIER.pdf
CS8080_IRT_UNIT - III T6 K-NN CLASSIFIER.pdf
 
KNN
KNN KNN
KNN
 
k-mean-clustering.pdf
k-mean-clustering.pdfk-mean-clustering.pdf
k-mean-clustering.pdf
 
K-Means Clustering Algorithm.pptx
K-Means Clustering Algorithm.pptxK-Means Clustering Algorithm.pptx
K-Means Clustering Algorithm.pptx
 
Machine learning clustering
Machine learning clusteringMachine learning clustering
Machine learning clustering
 
Fa18_P2.pptx
Fa18_P2.pptxFa18_P2.pptx
Fa18_P2.pptx
 
Presentation Template__TY_AIML_IE2_Project (1).pptx
Presentation Template__TY_AIML_IE2_Project (1).pptxPresentation Template__TY_AIML_IE2_Project (1).pptx
Presentation Template__TY_AIML_IE2_Project (1).pptx
 
K-Means Algorithm Implementation In python
K-Means Algorithm Implementation In pythonK-Means Algorithm Implementation In python
K-Means Algorithm Implementation In python
 
Fake currency detection using knn algorithm.pptx
Fake currency detection using knn algorithm.pptxFake currency detection using knn algorithm.pptx
Fake currency detection using knn algorithm.pptx
 
Knn 160904075605-converted
Knn 160904075605-convertedKnn 160904075605-converted
Knn 160904075605-converted
 
Csci101 lect10 algorithms_iii
Csci101 lect10 algorithms_iiiCsci101 lect10 algorithms_iii
Csci101 lect10 algorithms_iii
 

More from Shiraz316

FINGERNAIL DISORDER DETECTION FOR DISEASE ANALYSIS
FINGERNAIL DISORDER DETECTION FOR DISEASE ANALYSISFINGERNAIL DISORDER DETECTION FOR DISEASE ANALYSIS
FINGERNAIL DISORDER DETECTION FOR DISEASE ANALYSISShiraz316
 
Khi 087 revised dt report
Khi 087 revised dt reportKhi 087 revised dt report
Khi 087 revised dt reportShiraz316
 
Khi 117 revised dt report
Khi 117 revised dt reportKhi 117 revised dt report
Khi 117 revised dt reportShiraz316
 
Khi 164 revised dt report
Khi 164 revised dt reportKhi 164 revised dt report
Khi 164 revised dt reportShiraz316
 
Khi 054 revised dt report
Khi 054 revised dt reportKhi 054 revised dt report
Khi 054 revised dt reportShiraz316
 
Khi 061 revised dt report
Khi 061 revised dt reportKhi 061 revised dt report
Khi 061 revised dt reportShiraz316
 
Khi 022 revised dt report
Khi 022 revised dt reportKhi 022 revised dt report
Khi 022 revised dt reportShiraz316
 
Khi 113 revised dt report
Khi 113 revised dt reportKhi 113 revised dt report
Khi 113 revised dt reportShiraz316
 
Khi 156 revised dt report
Khi 156 revised dt reportKhi 156 revised dt report
Khi 156 revised dt reportShiraz316
 
Khi 142 revised dt report
Khi 142 revised dt reportKhi 142 revised dt report
Khi 142 revised dt reportShiraz316
 
Khi 316 revised dt report
Khi 316 revised dt reportKhi 316 revised dt report
Khi 316 revised dt reportShiraz316
 
Khi 186 revised dt report
Khi 186 revised dt reportKhi 186 revised dt report
Khi 186 revised dt reportShiraz316
 
Khi 052 revised dt report
Khi 052 revised dt reportKhi 052 revised dt report
Khi 052 revised dt reportShiraz316
 
Khi 151 revised dt report
Khi 151 revised dt reportKhi 151 revised dt report
Khi 151 revised dt reportShiraz316
 
Khi 150 revised dt report
Khi 150 revised dt reportKhi 150 revised dt report
Khi 150 revised dt reportShiraz316
 
Khi 078 revised dt report
Khi 078 revised dt reportKhi 078 revised dt report
Khi 078 revised dt reportShiraz316
 
LTE quick introduction session Training
LTE quick introduction session TrainingLTE quick introduction session Training
LTE quick introduction session TrainingShiraz316
 
LTE Sales Training for CPE Device
LTE Sales Training for CPE DeviceLTE Sales Training for CPE Device
LTE Sales Training for CPE DeviceShiraz316
 
Witribe Customer Premises Equipment Training for LTE
Witribe Customer Premises Equipment Training for LTEWitribe Customer Premises Equipment Training for LTE
Witribe Customer Premises Equipment Training for LTEShiraz316
 
Network entry success rate
Network entry success rateNetwork entry success rate
Network entry success rateShiraz316
 

More from Shiraz316 (20)

FINGERNAIL DISORDER DETECTION FOR DISEASE ANALYSIS
FINGERNAIL DISORDER DETECTION FOR DISEASE ANALYSISFINGERNAIL DISORDER DETECTION FOR DISEASE ANALYSIS
FINGERNAIL DISORDER DETECTION FOR DISEASE ANALYSIS
 
Khi 087 revised dt report
Khi 087 revised dt reportKhi 087 revised dt report
Khi 087 revised dt report
 
Khi 117 revised dt report
Khi 117 revised dt reportKhi 117 revised dt report
Khi 117 revised dt report
 
Khi 164 revised dt report
Khi 164 revised dt reportKhi 164 revised dt report
Khi 164 revised dt report
 
Khi 054 revised dt report
Khi 054 revised dt reportKhi 054 revised dt report
Khi 054 revised dt report
 
Khi 061 revised dt report
Khi 061 revised dt reportKhi 061 revised dt report
Khi 061 revised dt report
 
Khi 022 revised dt report
Khi 022 revised dt reportKhi 022 revised dt report
Khi 022 revised dt report
 
Khi 113 revised dt report
Khi 113 revised dt reportKhi 113 revised dt report
Khi 113 revised dt report
 
Khi 156 revised dt report
Khi 156 revised dt reportKhi 156 revised dt report
Khi 156 revised dt report
 
Khi 142 revised dt report
Khi 142 revised dt reportKhi 142 revised dt report
Khi 142 revised dt report
 
Khi 316 revised dt report
Khi 316 revised dt reportKhi 316 revised dt report
Khi 316 revised dt report
 
Khi 186 revised dt report
Khi 186 revised dt reportKhi 186 revised dt report
Khi 186 revised dt report
 
Khi 052 revised dt report
Khi 052 revised dt reportKhi 052 revised dt report
Khi 052 revised dt report
 
Khi 151 revised dt report
Khi 151 revised dt reportKhi 151 revised dt report
Khi 151 revised dt report
 
Khi 150 revised dt report
Khi 150 revised dt reportKhi 150 revised dt report
Khi 150 revised dt report
 
Khi 078 revised dt report
Khi 078 revised dt reportKhi 078 revised dt report
Khi 078 revised dt report
 
LTE quick introduction session Training
LTE quick introduction session TrainingLTE quick introduction session Training
LTE quick introduction session Training
 
LTE Sales Training for CPE Device
LTE Sales Training for CPE DeviceLTE Sales Training for CPE Device
LTE Sales Training for CPE Device
 
Witribe Customer Premises Equipment Training for LTE
Witribe Customer Premises Equipment Training for LTEWitribe Customer Premises Equipment Training for LTE
Witribe Customer Premises Equipment Training for LTE
 
Network entry success rate
Network entry success rateNetwork entry success rate
Network entry success rate
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

K neareast neighbor algorithm presentation

  • 1. K-NEAREAST NEIGHBOR ALGORITHM PRESENTATION INSTRUCTOR NAME- SIR ALI SHIRAZ GROUP MEMBER ABDUL WASAY – BB-6474 ARSALAN AHMED KHAN – BB-6490
  • 2. * Contents 1. Introduction 2.Why we need to use K-NN Algorithm 3. How does K-NN Algorithm works 4. How to select K value in K-NN Algorithm 5. Advantages and Disadvantages of K-NN Algorithm
  • 3. *INTRODUCTION  K-Nearest Neighbor is one of the simplest Machine Learning algorithms.  K-NN algorithm assumes the similarity between the new case/data and available cases.  K-NN algorithm stores all the available data and classifies a new data point based on the similarity.  K-NN algorithm can be used for Regression as well as for Classification  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  K-NN algorithm at the training phase just stores the dataset and when it gets new data.
  • 4. *Example: • Suppose, we have an image of a creature that looks similar to a cat and dog, but we want to know either it is a cat or dog. So, for this identification, we can use the KNN algorithm, as it works on a similarity measure. Our KNN model will find the similar features of the new data set to the cats and dogs’ images and based on the most similar features it will put it in either cat or dog category.
  • 5. * Why do we need a K-NN Algorithm? Suppose there are two categories, i.e., Category A and Category B, and we have a new data point x1, so this data point will lie in which of these categories. To solve this type of problem, we need a K-NN algorithm. With the help of K-NN, we can easily identify the category or class of a particular dataset. Consider the below diagram:
  • 6. *How does K-NN work? • The K-NN working can be explained on the basis of the below algorithm: • Step-1: Select the number K of the neighbors • Step-2: Calculate the Euclidean distance of K number of neighbors • Step-3: Take the K nearest neighbors as per the calculated Euclidean distance. • Step-4: Among these k neighbors, count the number of the data points in each category. • Step-5: Assign the new data points to that category for which the number of the neighbor is maximum. • Step-6: Our model is ready.
  • 7. *How to select the value of K in the K-NN Algorithm? • There is no particular way to determine the best value for "K", so we need to try some values to find the best out of them. The most preferred value for K is 5. • A very low value for K such as K=1 or K=2, can be noisy and lead to the effects of outliers in the model. • Large values for K are good, but it may find some difficulties.
  • 8. Advantages of K-NN Algorithm: It is simple to implement. It is lazy learner, so therefore required no training It can be more effective if the training data is large. New data can be added seamlessly. Disadvantages of KNN Algorithm: Always needs to determine the value of K which may be complex some time. The computation cost is high because of calculating the distance between the data points for all the training samples.