K - Nearest Neighbor Algorithm
K - Nearest Neighbor Algorithm
Algorithm
Presented by:
Introduction
Classification Approach
Working
How to Choose “K”?
Advantages
Disadvantages
Applications
References
Sarhad University
Peshawar
INTRODUCTION 3
[1]
Sarhad University
Peshawar
KNN: CLASSIFICATION APPROACH 4
Sarhad University
Peshawar
KNN: DISTANCE FUNCTIONS 5
Sarhad University
Peshawar
KNN: DISTANCE FUNCTIONS 6
Sarhad University
Peshawar
KNN: OTHER DISTANCE FUNCTIONS 7
Mickowsky
Correlation
Chi-square
Sarhad University
Peshawar
WORKING (CLASSIFICATION) 8
(Weight) W
Example
Let K = 3
Find Class of New Tumer?
(Diameter) D
Benign Tumer (Lower Diameter and Lower Weight).
Malignant Tumer (Higher Diameter and Higher Weight)
Sarhad University
Peshawar
WORKING (CLASSIFICATION) 9
W
Example
Let K = 5
Find Class of New Tumer?
D
Benign Tumer (Lower Diameter and Lower Weight).
Malignant Tumer (Higher Diameter and Higher Wieght)
Sarhad University
Peshawar
HOW TO CHOOSE “K” ? 10
Sarhad University
Peshawar
ADVANTAGES OF KNN ALGORITHM 11
[2]
Sarhad University
Peshawar
DISADVANTAGES 12
[3]
Sarhad University
Peshawar
APPLICATIONS 13
Text Mining
Agriculture
Finance
Medicine
Pattern Recognition
[6]
Sarhad University
Peshawar
CONCLUSION 14
[1]
https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwiCxpb6xP7fAhXtMewKHW27BXAQjRx6BAgBEAU&url=ht
tps%3A%2F%2Fwww.researchgate.net%2Ffigure%2FKNN-algorithm-diagram_fig8_301299690&psig=AOvVaw0pp5LA9867vjhc54IN5--
Y&ust=1548148225663608
[2]
https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwibhIDBxf7fAhXIzKQKHWAsCZ0QjRx6BAgBEAU&url=http
%3A%2F%2Fsystemprotection.in%2Fadvantages-high-efficiency-
transformers%2F&psig=AOvVaw0OAawbEalwrI2PPmfPhkpy&ust=1548146639323306
[3]
https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwj9w5PAxf7fAhUOyaQKHdhMAuYQjRx6BAgBEAU&url=ht
tps%3A%2F%2Fwww.dreamstime.com%2Fdisadvantage-red-stamp-isolated-white-background-disadvantage-red-stamp-
image105120526&psig=AOvVaw2C2NyqQ6IrBqERPjwhXvwP&ust=1548146887293667
[4]
https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwjs1JqWxv7fAhULKewKHXVkDe8QjRx6BAgBEAU&url=htt
p%3A%2F%2Fmassagroup.co%2Fclip-art-data-and-conclusions.html&psig=AOvVaw3QwDp-4pZi11GkRJH_zGPI&ust=1548148875739266
[5] (Application of K-Nearest Neighbor (KNN) Approach for Predicting Economic Events: Theoretical Background
Sadegh Bafandeh Imandoust And Mohammad Bolandraftar Department of Economics,Payame Noor University, Tehran, Iran
) https://www.ijera.com/papers/Vol3_issue5/DI35605610.pdf
[6] https://familybuildingblocks.org/media/filer_public_thumbnails/filer_public/33/cc/33cca25c-c499-40b9-ac79-
176fcb9029cd/applications.png__900x300_q85_crop_subsampling-2_upscale.png
Sarhad University
Peshawar
REFERENCES (CONT…) 16
https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm
https://machinelearningmastery.com/k-nearest-neighbors-for-machine-learning/
https://saravananthirumuruganathan.wordpress.com/2010/05/17/a-detailed-introduction-to-k-nearest-neighbor-knn-
algorithm/
https://kevinzakka.github.io/2016/07/13/k-nearest-neighbor/
https://slideplayer.com/slide/7364467/?fbclid=IwAR3AHAvGXxInp-
TvvZGvFQmHNP0yv92p96N6IQasXmLVcYIMnwjloWTenVM
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4978658/
Sarhad University
Peshawar
Questions ?
Sarhad University
Peshawar
THANK YOU!
Sarhad University
Peshawar