SlideShare a Scribd company logo
1 of 13
Nearest Neighbor Algorithm Zaffar Ahmed Shaikh
Topics Introduction – Memory-based algorithms K-nearest neighbor (KNN) algorithm How KNN works? KNN Example Different types of KNN
Introduction ,[object Object],[object Object]
How KNN works? Determine K (no of nearest neighbors) Calculate distance (Euclidean, Manhattan) Determine K-minimum distance neighbors Gather category Y values of nearest neighbors  Use simple majority of nearest neighbors to predict value of query instance
KNN Example Predict who will win today’s Cricket match between India and Pakistan based on users rating and previous results of matches played between the two teams.
1. Determine K Determine value of K  Suppose K = 3 2. Calculate distance Coordinates of query instance are (4,3,3) Coordinates of training instance(1) are (7,2,1) D = SQRT ((7-4)2+(2-3) 2+(1-3) 2) = 3.74165
2. Calculate distance
3. Determine K-minimum distance neighbors K = 3
4. Gather category Y values of nearest neighbors
5. Use simple majority of nearest neighbors to predict value of query instance Here India has won 2 matches 2 (-) signs and Pakistan has won 1 match 1 (+) sign We conclude that India will win today’s match
Different types of KNN  KNN for Classification KNN for Prediction KNN for Smoothing
Thank you
Nearest Neighbor Algorithm  Zaffar Ahmed

More Related Content

What's hot

Feedforward neural network
Feedforward neural networkFeedforward neural network
Feedforward neural networkSopheaktra YONG
 
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...Simplilearn
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...Simplilearn
 
Unsupervised learning clustering
Unsupervised learning clusteringUnsupervised learning clustering
Unsupervised learning clusteringArshad Farhad
 
Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkKnoldus Inc.
 
Machine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksMachine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksFrancesco Collova'
 
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceMaryamRehman6
 
Autoencoders in Deep Learning
Autoencoders in Deep LearningAutoencoders in Deep Learning
Autoencoders in Deep Learningmilad abbasi
 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural NetworksDatabricks
 
K MEANS CLUSTERING
K MEANS CLUSTERINGK MEANS CLUSTERING
K MEANS CLUSTERINGsingh7599
 
Support Vector Machine without tears
Support Vector Machine without tearsSupport Vector Machine without tears
Support Vector Machine without tearsAnkit Sharma
 
Artificial Intelligence: Artificial Neural Networks
Artificial Intelligence: Artificial Neural NetworksArtificial Intelligence: Artificial Neural Networks
Artificial Intelligence: Artificial Neural NetworksThe Integral Worm
 
Lecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation MaximizationLecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation Maximizationbutest
 

What's hot (20)

K Nearest Neighbors
K Nearest NeighborsK Nearest Neighbors
K Nearest Neighbors
 
Feedforward neural network
Feedforward neural networkFeedforward neural network
Feedforward neural network
 
KNN
KNN KNN
KNN
 
Knn
KnnKnn
Knn
 
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
 
Presentation on K-Means Clustering
Presentation on K-Means ClusteringPresentation on K-Means Clustering
Presentation on K-Means Clustering
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
 
Unsupervised learning clustering
Unsupervised learning clusteringUnsupervised learning clustering
Unsupervised learning clustering
 
K means Clustering Algorithm
K means Clustering AlgorithmK means Clustering Algorithm
K means Clustering Algorithm
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
 
Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural Network
 
Machine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksMachine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural Networks
 
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data science
 
Autoencoders in Deep Learning
Autoencoders in Deep LearningAutoencoders in Deep Learning
Autoencoders in Deep Learning
 
Random forest
Random forestRandom forest
Random forest
 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural Networks
 
K MEANS CLUSTERING
K MEANS CLUSTERINGK MEANS CLUSTERING
K MEANS CLUSTERING
 
Support Vector Machine without tears
Support Vector Machine without tearsSupport Vector Machine without tears
Support Vector Machine without tears
 
Artificial Intelligence: Artificial Neural Networks
Artificial Intelligence: Artificial Neural NetworksArtificial Intelligence: Artificial Neural Networks
Artificial Intelligence: Artificial Neural Networks
 
Lecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation MaximizationLecture 18: Gaussian Mixture Models and Expectation Maximization
Lecture 18: Gaussian Mixture Models and Expectation Maximization
 

Similar to Nearest Neighbor Algorithm Zaffar Ahmed

K- Nearest Neighbor Approach
K- Nearest Neighbor ApproachK- Nearest Neighbor Approach
K- Nearest Neighbor ApproachKumud Arora
 
instance bases k nearest neighbor algorithm.ppt
instance bases k nearest neighbor algorithm.pptinstance bases k nearest neighbor algorithm.ppt
instance bases k nearest neighbor algorithm.pptJohny139575
 
Machine learning in science and industry — day 1
Machine learning in science and industry — day 1Machine learning in science and industry — day 1
Machine learning in science and industry — day 1arogozhnikov
 
Enhancing Classification Accuracy of K-Nearest Neighbors Algorithm using Gain...
Enhancing Classification Accuracy of K-Nearest Neighbors Algorithm using Gain...Enhancing Classification Accuracy of K-Nearest Neighbors Algorithm using Gain...
Enhancing Classification Accuracy of K-Nearest Neighbors Algorithm using Gain...IRJET Journal
 
Poggi analytics - distance - 1a
Poggi   analytics - distance - 1aPoggi   analytics - distance - 1a
Poggi analytics - distance - 1aGaston Liberman
 
Machine Learning: Classification Concepts (Part 1)
Machine Learning: Classification Concepts (Part 1)Machine Learning: Classification Concepts (Part 1)
Machine Learning: Classification Concepts (Part 1)Daniel Chan
 
K-Means Clustering Simply
K-Means Clustering SimplyK-Means Clustering Simply
K-Means Clustering SimplyEmad Nabil
 
MLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic trackMLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic trackarogozhnikov
 
Ml9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methodsMl9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methodsankit_ppt
 
ENBIS 2018 presentation on Deep k-Means
ENBIS 2018 presentation on Deep k-MeansENBIS 2018 presentation on Deep k-Means
ENBIS 2018 presentation on Deep k-Meanstthonet
 
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
ANLY 501 Lab 7 Presentation Group 8 slide.pptxANLY 501 Lab 7 Presentation Group 8 slide.pptx
ANLY 501 Lab 7 Presentation Group 8 slide.pptxrinehi3578
 
Vectorise all the things
Vectorise all the thingsVectorise all the things
Vectorise all the thingsJodieBurchell1
 
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural N...
Classification of Iris Data using Kernel Radial Basis Probabilistic  Neural N...Classification of Iris Data using Kernel Radial Basis Probabilistic  Neural N...
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural N...Scientific Review SR
 
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural Ne...
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural Ne...Classification of Iris Data using Kernel Radial Basis Probabilistic Neural Ne...
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural Ne...Scientific Review
 

Similar to Nearest Neighbor Algorithm Zaffar Ahmed (20)

knn-1.pptx
knn-1.pptxknn-1.pptx
knn-1.pptx
 
K- Nearest Neighbor Approach
K- Nearest Neighbor ApproachK- Nearest Neighbor Approach
K- Nearest Neighbor Approach
 
instance bases k nearest neighbor algorithm.ppt
instance bases k nearest neighbor algorithm.pptinstance bases k nearest neighbor algorithm.ppt
instance bases k nearest neighbor algorithm.ppt
 
KNN.pptx
KNN.pptxKNN.pptx
KNN.pptx
 
K-Nearest Neighbor(KNN)
K-Nearest Neighbor(KNN)K-Nearest Neighbor(KNN)
K-Nearest Neighbor(KNN)
 
Machine learning in science and industry — day 1
Machine learning in science and industry — day 1Machine learning in science and industry — day 1
Machine learning in science and industry — day 1
 
Enhancing Classification Accuracy of K-Nearest Neighbors Algorithm using Gain...
Enhancing Classification Accuracy of K-Nearest Neighbors Algorithm using Gain...Enhancing Classification Accuracy of K-Nearest Neighbors Algorithm using Gain...
Enhancing Classification Accuracy of K-Nearest Neighbors Algorithm using Gain...
 
Poggi analytics - distance - 1a
Poggi   analytics - distance - 1aPoggi   analytics - distance - 1a
Poggi analytics - distance - 1a
 
Machine Learning: Classification Concepts (Part 1)
Machine Learning: Classification Concepts (Part 1)Machine Learning: Classification Concepts (Part 1)
Machine Learning: Classification Concepts (Part 1)
 
Data analysis of weather forecasting
Data analysis of weather forecastingData analysis of weather forecasting
Data analysis of weather forecasting
 
TunUp final presentation
TunUp final presentationTunUp final presentation
TunUp final presentation
 
K-Means Clustering Simply
K-Means Clustering SimplyK-Means Clustering Simply
K-Means Clustering Simply
 
Knn demonstration
Knn demonstrationKnn demonstration
Knn demonstration
 
MLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic trackMLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic track
 
Ml9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methodsMl9 introduction to-unsupervised_learning_and_clustering_methods
Ml9 introduction to-unsupervised_learning_and_clustering_methods
 
ENBIS 2018 presentation on Deep k-Means
ENBIS 2018 presentation on Deep k-MeansENBIS 2018 presentation on Deep k-Means
ENBIS 2018 presentation on Deep k-Means
 
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
ANLY 501 Lab 7 Presentation Group 8 slide.pptxANLY 501 Lab 7 Presentation Group 8 slide.pptx
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
 
Vectorise all the things
Vectorise all the thingsVectorise all the things
Vectorise all the things
 
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural N...
Classification of Iris Data using Kernel Radial Basis Probabilistic  Neural N...Classification of Iris Data using Kernel Radial Basis Probabilistic  Neural N...
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural N...
 
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural Ne...
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural Ne...Classification of Iris Data using Kernel Radial Basis Probabilistic Neural Ne...
Classification of Iris Data using Kernel Radial Basis Probabilistic Neural Ne...
 

More from Zaffar Ahmed Shaikh

SkillsRec: A Novel Semantic Analysis Driven Learner Skills Mining and Filteri...
SkillsRec: A Novel Semantic Analysis Driven Learner Skills Mining and Filteri...SkillsRec: A Novel Semantic Analysis Driven Learner Skills Mining and Filteri...
SkillsRec: A Novel Semantic Analysis Driven Learner Skills Mining and Filteri...Zaffar Ahmed Shaikh
 
Identifying Measures to Foster Teachers’ Competence for Personal Learning Env...
Identifying Measures to Foster Teachers’ Competence for Personal Learning Env...Identifying Measures to Foster Teachers’ Competence for Personal Learning Env...
Identifying Measures to Foster Teachers’ Competence for Personal Learning Env...Zaffar Ahmed Shaikh
 
Higher Education in Pakistan: An ICT Integration Viewpoint
Higher Education in Pakistan: An ICT Integration ViewpointHigher Education in Pakistan: An ICT Integration Viewpoint
Higher Education in Pakistan: An ICT Integration ViewpointZaffar Ahmed Shaikh
 
Presentation: Higher Education in Pakistan: An ICT Integration Viewpoint
Presentation: Higher Education in Pakistan: An ICT Integration ViewpointPresentation: Higher Education in Pakistan: An ICT Integration Viewpoint
Presentation: Higher Education in Pakistan: An ICT Integration ViewpointZaffar Ahmed Shaikh
 
Presentation: ZPD Incidence Development Strategy for Demand of ICTs in Higher...
Presentation: ZPD Incidence Development Strategy for Demand of ICTs in Higher...Presentation: ZPD Incidence Development Strategy for Demand of ICTs in Higher...
Presentation: ZPD Incidence Development Strategy for Demand of ICTs in Higher...Zaffar Ahmed Shaikh
 
Usage, Acceptance, Adoption, and Diffusion of Information & Communication Tec...
Usage, Acceptance, Adoption, and Diffusion of Information & Communication Tec...Usage, Acceptance, Adoption, and Diffusion of Information & Communication Tec...
Usage, Acceptance, Adoption, and Diffusion of Information & Communication Tec...Zaffar Ahmed Shaikh
 
Role of ICT in Shaping the Future of Pakistani Higher Education System
Role of ICT in Shaping the Future of Pakistani Higher Education SystemRole of ICT in Shaping the Future of Pakistani Higher Education System
Role of ICT in Shaping the Future of Pakistani Higher Education SystemZaffar Ahmed Shaikh
 
Role of Teacher in Personal Learning Environments
Role of Teacher in Personal Learning EnvironmentsRole of Teacher in Personal Learning Environments
Role of Teacher in Personal Learning EnvironmentsZaffar Ahmed Shaikh
 
Presentation - Role of Teacher in Personal Learning Environments
Presentation - Role of Teacher in Personal Learning EnvironmentsPresentation - Role of Teacher in Personal Learning Environments
Presentation - Role of Teacher in Personal Learning EnvironmentsZaffar Ahmed Shaikh
 
Introduction to Social Computing - Book Chapter
Introduction to Social Computing - Book ChapterIntroduction to Social Computing - Book Chapter
Introduction to Social Computing - Book ChapterZaffar Ahmed Shaikh
 
Chapter 2 Cover Updated By Zaffar Ahmed Shaikh
Chapter 2 Cover Updated By Zaffar Ahmed ShaikhChapter 2 Cover Updated By Zaffar Ahmed Shaikh
Chapter 2 Cover Updated By Zaffar Ahmed ShaikhZaffar Ahmed Shaikh
 
Chapter 1 Cover Updated By Zaffar Ahmed Shaikh
Chapter 1 Cover Updated By Zaffar Ahmed ShaikhChapter 1 Cover Updated By Zaffar Ahmed Shaikh
Chapter 1 Cover Updated By Zaffar Ahmed ShaikhZaffar Ahmed Shaikh
 
Trust Based Recommendation Systems For Tourism System Zaffar Ahmed Shaikh
Trust Based Recommendation Systems For Tourism System   Zaffar Ahmed ShaikhTrust Based Recommendation Systems For Tourism System   Zaffar Ahmed Shaikh
Trust Based Recommendation Systems For Tourism System Zaffar Ahmed ShaikhZaffar Ahmed Shaikh
 
Social Computing Applications Infrastructure
Social Computing Applications InfrastructureSocial Computing Applications Infrastructure
Social Computing Applications InfrastructureZaffar Ahmed Shaikh
 
Zaffar+Ahmed+ +Collaborative+Filtering
Zaffar+Ahmed+ +Collaborative+FilteringZaffar+Ahmed+ +Collaborative+Filtering
Zaffar+Ahmed+ +Collaborative+FilteringZaffar Ahmed Shaikh
 

More from Zaffar Ahmed Shaikh (17)

SkillsRec: A Novel Semantic Analysis Driven Learner Skills Mining and Filteri...
SkillsRec: A Novel Semantic Analysis Driven Learner Skills Mining and Filteri...SkillsRec: A Novel Semantic Analysis Driven Learner Skills Mining and Filteri...
SkillsRec: A Novel Semantic Analysis Driven Learner Skills Mining and Filteri...
 
Identifying Measures to Foster Teachers’ Competence for Personal Learning Env...
Identifying Measures to Foster Teachers’ Competence for Personal Learning Env...Identifying Measures to Foster Teachers’ Competence for Personal Learning Env...
Identifying Measures to Foster Teachers’ Competence for Personal Learning Env...
 
Higher Education in Pakistan: An ICT Integration Viewpoint
Higher Education in Pakistan: An ICT Integration ViewpointHigher Education in Pakistan: An ICT Integration Viewpoint
Higher Education in Pakistan: An ICT Integration Viewpoint
 
Presentation: Higher Education in Pakistan: An ICT Integration Viewpoint
Presentation: Higher Education in Pakistan: An ICT Integration ViewpointPresentation: Higher Education in Pakistan: An ICT Integration Viewpoint
Presentation: Higher Education in Pakistan: An ICT Integration Viewpoint
 
Presentation: ZPD Incidence Development Strategy for Demand of ICTs in Higher...
Presentation: ZPD Incidence Development Strategy for Demand of ICTs in Higher...Presentation: ZPD Incidence Development Strategy for Demand of ICTs in Higher...
Presentation: ZPD Incidence Development Strategy for Demand of ICTs in Higher...
 
Usage, Acceptance, Adoption, and Diffusion of Information & Communication Tec...
Usage, Acceptance, Adoption, and Diffusion of Information & Communication Tec...Usage, Acceptance, Adoption, and Diffusion of Information & Communication Tec...
Usage, Acceptance, Adoption, and Diffusion of Information & Communication Tec...
 
Role of ICT in Shaping the Future of Pakistani Higher Education System
Role of ICT in Shaping the Future of Pakistani Higher Education SystemRole of ICT in Shaping the Future of Pakistani Higher Education System
Role of ICT in Shaping the Future of Pakistani Higher Education System
 
Role of Teacher in Personal Learning Environments
Role of Teacher in Personal Learning EnvironmentsRole of Teacher in Personal Learning Environments
Role of Teacher in Personal Learning Environments
 
Presentation - Role of Teacher in Personal Learning Environments
Presentation - Role of Teacher in Personal Learning EnvironmentsPresentation - Role of Teacher in Personal Learning Environments
Presentation - Role of Teacher in Personal Learning Environments
 
Network Theory
Network TheoryNetwork Theory
Network Theory
 
Introduction to Social Computing - Book Chapter
Introduction to Social Computing - Book ChapterIntroduction to Social Computing - Book Chapter
Introduction to Social Computing - Book Chapter
 
Chapter 2 Cover Updated By Zaffar Ahmed Shaikh
Chapter 2 Cover Updated By Zaffar Ahmed ShaikhChapter 2 Cover Updated By Zaffar Ahmed Shaikh
Chapter 2 Cover Updated By Zaffar Ahmed Shaikh
 
Chapter 1 Cover Updated By Zaffar Ahmed Shaikh
Chapter 1 Cover Updated By Zaffar Ahmed ShaikhChapter 1 Cover Updated By Zaffar Ahmed Shaikh
Chapter 1 Cover Updated By Zaffar Ahmed Shaikh
 
Prediction Markets
Prediction MarketsPrediction Markets
Prediction Markets
 
Trust Based Recommendation Systems For Tourism System Zaffar Ahmed Shaikh
Trust Based Recommendation Systems For Tourism System   Zaffar Ahmed ShaikhTrust Based Recommendation Systems For Tourism System   Zaffar Ahmed Shaikh
Trust Based Recommendation Systems For Tourism System Zaffar Ahmed Shaikh
 
Social Computing Applications Infrastructure
Social Computing Applications InfrastructureSocial Computing Applications Infrastructure
Social Computing Applications Infrastructure
 
Zaffar+Ahmed+ +Collaborative+Filtering
Zaffar+Ahmed+ +Collaborative+FilteringZaffar+Ahmed+ +Collaborative+Filtering
Zaffar+Ahmed+ +Collaborative+Filtering
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

Nearest Neighbor Algorithm Zaffar Ahmed

  • 1. Nearest Neighbor Algorithm Zaffar Ahmed Shaikh
  • 2. Topics Introduction – Memory-based algorithms K-nearest neighbor (KNN) algorithm How KNN works? KNN Example Different types of KNN
  • 3.
  • 4. How KNN works? Determine K (no of nearest neighbors) Calculate distance (Euclidean, Manhattan) Determine K-minimum distance neighbors Gather category Y values of nearest neighbors Use simple majority of nearest neighbors to predict value of query instance
  • 5. KNN Example Predict who will win today’s Cricket match between India and Pakistan based on users rating and previous results of matches played between the two teams.
  • 6. 1. Determine K Determine value of K Suppose K = 3 2. Calculate distance Coordinates of query instance are (4,3,3) Coordinates of training instance(1) are (7,2,1) D = SQRT ((7-4)2+(2-3) 2+(1-3) 2) = 3.74165
  • 8. 3. Determine K-minimum distance neighbors K = 3
  • 9. 4. Gather category Y values of nearest neighbors
  • 10. 5. Use simple majority of nearest neighbors to predict value of query instance Here India has won 2 matches 2 (-) signs and Pakistan has won 1 match 1 (+) sign We conclude that India will win today’s match
  • 11. Different types of KNN KNN for Classification KNN for Prediction KNN for Smoothing