SlideShare a Scribd company logo
1 of 16
K-Nearest Neighbor
Learning
By ASHWANI JHA
Different Learning Methods
 Eager Learning
 Explicit description of target function on
the whole training set
 Instance-based Learning
 Learning=storing all training instances
 Classification=assigning target function
to a new instance
 Referred to as “Lazy” learning
Different Learning Methods
 Eager Learning
Any random movement
=>It’s a mouse
I saw a mouse!
Instance-based Learning
Its very similar to a
Desktop!!
Instance-based Learning
 K-Nearest Neighbor Algorithm
 Weighted Regression
 Case-based reasoning
K-Nearest Neighbor
 Features
 All instances correspond to points in an
n-dimensional Euclidean space
 Classification is delayed till a new
instance arrives
 Classification done by comparing
feature vectors of the different points
 Target function may be discrete or real-
valued
1-Nearest Neighbor
3-Nearest Neighbor
K-Nearest Neighbor
 An arbitrary instance is represented by
(a1(x), a2(x), a3(x),.., an(x))
 ai(x) denotes features
 Euclidean distance between two instances
d(xi, xj)=sqrt (sum for r=1 to n (ar(xi) -
ar(xj))2
)
 Continuous valued target function
 mean value of the k nearest training
examples
Voronoi Diagram
 Decision surface formed by the
training examples
Distance-Weighted Nearest
Neighbor Algorithm
 Assign weights to the neighbors
based on their ‘distance’ from the
query point
 Weight ‘may’ be inverse square of the
distances
All training points may influence a
particular instance
 Shepard’s method
Remarks
+Highly effective inductive inference
method for noisy training data and
complex target functions
+Target function for a whole space
may be described as a combination
of less complex local approximations
+Learning is very simple
- Classification is time consuming
Remarks
- Curse of Dimensionality
Remarks
- Curse of Dimensionality
Remarks
- Curse of Dimensionality
Remarks
 Efficient memory indexing
 To retrieve the stored training
examples (kd-tree)

More Related Content

Viewers also liked

K nearest neighbor
K nearest neighborK nearest neighbor
K nearest neighborUjjawal
 
k Nearest Neighbor
k Nearest Neighbork Nearest Neighbor
k Nearest Neighborbutest
 
Text classification methods
Text classification methodsText classification methods
Text classification methodsYoung Alista
 
Using Adaboost Algorithm to Enhance the Prediction Accuracy of Decision Trees
Using Adaboost Algorithm to Enhance the Prediction Accuracy of Decision TreesUsing Adaboost Algorithm to Enhance the Prediction Accuracy of Decision Trees
Using Adaboost Algorithm to Enhance the Prediction Accuracy of Decision TreesMohammed Al Hamadi
 
Naive bayes
Naive bayesNaive bayes
Naive bayesumeskath
 
Query dependent ranking using k nearest neighbor
Query dependent ranking using k nearest neighborQuery dependent ranking using k nearest neighbor
Query dependent ranking using k nearest neighboriyo
 
[14HCB]-Tìm Hiểu Weka
[14HCB]-Tìm Hiểu Weka[14HCB]-Tìm Hiểu Weka
[14HCB]-Tìm Hiểu WekaTran Van Cuong
 
KHAI PHÁ LUẬT KẾT HỢP CÁC MÔN HỌC CỦA SINH VIÊN
KHAI PHÁ LUẬT KẾT HỢP CÁC MÔN HỌC CỦA SINH VIÊNKHAI PHÁ LUẬT KẾT HỢP CÁC MÔN HỌC CỦA SINH VIÊN
KHAI PHÁ LUẬT KẾT HỢP CÁC MÔN HỌC CỦA SINH VIÊNVu Truong
 
Lecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest NeighborsLecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest NeighborsMarina Santini
 
Introduction to text classification using naive bayes
Introduction to text classification using naive bayesIntroduction to text classification using naive bayes
Introduction to text classification using naive bayesDhwaj Raj
 
CCNA 2 Routing and Switching v5.0 Chapter 9
CCNA 2 Routing and Switching v5.0 Chapter 9CCNA 2 Routing and Switching v5.0 Chapter 9
CCNA 2 Routing and Switching v5.0 Chapter 9Nil Menon
 

Viewers also liked (20)

K nearest neighbor
K nearest neighborK nearest neighbor
K nearest neighbor
 
k Nearest Neighbor
k Nearest Neighbork Nearest Neighbor
k Nearest Neighbor
 
K-Nearest Neighbor
K-Nearest NeighborK-Nearest Neighbor
K-Nearest Neighbor
 
Bai 4 Phan Lop
Bai 4 Phan LopBai 4 Phan Lop
Bai 4 Phan Lop
 
Text classification methods
Text classification methodsText classification methods
Text classification methods
 
Nguyen dinhnghi do-an
Nguyen dinhnghi do-anNguyen dinhnghi do-an
Nguyen dinhnghi do-an
 
Using Adaboost Algorithm to Enhance the Prediction Accuracy of Decision Trees
Using Adaboost Algorithm to Enhance the Prediction Accuracy of Decision TreesUsing Adaboost Algorithm to Enhance the Prediction Accuracy of Decision Trees
Using Adaboost Algorithm to Enhance the Prediction Accuracy of Decision Trees
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
 
Query dependent ranking using k nearest neighbor
Query dependent ranking using k nearest neighborQuery dependent ranking using k nearest neighbor
Query dependent ranking using k nearest neighbor
 
[14HCB]-Tìm Hiểu Weka
[14HCB]-Tìm Hiểu Weka[14HCB]-Tìm Hiểu Weka
[14HCB]-Tìm Hiểu Weka
 
Concept learning
Concept learningConcept learning
Concept learning
 
KHAI PHÁ LUẬT KẾT HỢP CÁC MÔN HỌC CỦA SINH VIÊN
KHAI PHÁ LUẬT KẾT HỢP CÁC MÔN HỌC CỦA SINH VIÊNKHAI PHÁ LUẬT KẾT HỢP CÁC MÔN HỌC CỦA SINH VIÊN
KHAI PHÁ LUẬT KẾT HỢP CÁC MÔN HỌC CỦA SINH VIÊN
 
Lecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest NeighborsLecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest Neighbors
 
K Nearest Neighbors
K Nearest NeighborsK Nearest Neighbors
K Nearest Neighbors
 
Naive Bayes | Statistics
Naive Bayes | StatisticsNaive Bayes | Statistics
Naive Bayes | Statistics
 
Naive Bayes
Naive Bayes Naive Bayes
Naive Bayes
 
Introduction to text classification using naive bayes
Introduction to text classification using naive bayesIntroduction to text classification using naive bayes
Introduction to text classification using naive bayes
 
Lecture10 - Naïve Bayes
Lecture10 - Naïve BayesLecture10 - Naïve Bayes
Lecture10 - Naïve Bayes
 
CCNA 2 Routing and Switching v5.0 Chapter 9
CCNA 2 Routing and Switching v5.0 Chapter 9CCNA 2 Routing and Switching v5.0 Chapter 9
CCNA 2 Routing and Switching v5.0 Chapter 9
 
Random forest
Random forestRandom forest
Random forest
 

Similar to K nn

k nearest neighbour Machine Learning AI.
k nearest neighbour Machine Learning AI.k nearest neighbour Machine Learning AI.
k nearest neighbour Machine Learning AI.bismahmalik22
 
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
 
Poggi analytics - distance - 1a
Poggi   analytics - distance - 1aPoggi   analytics - distance - 1a
Poggi analytics - distance - 1aGaston Liberman
 
08 decrease and conquer spring 15
08 decrease and conquer spring 1508 decrease and conquer spring 15
08 decrease and conquer spring 15Hira Gul
 
Principles of functional progrmming in scala
Principles of functional progrmming in scalaPrinciples of functional progrmming in scala
Principles of functional progrmming in scalaehsoon
 
Chap 3php array part 3
Chap 3php array part 3Chap 3php array part 3
Chap 3php array part 3monikadeshmane
 
15_wk4_unsupervised-learning_manifold-EM-cs365-2014.pdf
15_wk4_unsupervised-learning_manifold-EM-cs365-2014.pdf15_wk4_unsupervised-learning_manifold-EM-cs365-2014.pdf
15_wk4_unsupervised-learning_manifold-EM-cs365-2014.pdfMcSwathi
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence butest
 
Property Based Testing [5] - Software Testing Techniques (CIS640)
Property Based Testing [5] - Software Testing Techniques (CIS640)Property Based Testing [5] - Software Testing Techniques (CIS640)
Property Based Testing [5] - Software Testing Techniques (CIS640)Venkatesh Prasad Ranganath
 

Similar to K nn (13)

k-nn.ppt
k-nn.pptk-nn.ppt
k-nn.ppt
 
k-nn.ppt
k-nn.pptk-nn.ppt
k-nn.ppt
 
k nearest neighbour Machine Learning AI.
k nearest neighbour Machine Learning AI.k nearest neighbour Machine Learning AI.
k nearest neighbour Machine Learning AI.
 
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
 
Poggi analytics - distance - 1a
Poggi   analytics - distance - 1aPoggi   analytics - distance - 1a
Poggi analytics - distance - 1a
 
08 decrease and conquer spring 15
08 decrease and conquer spring 1508 decrease and conquer spring 15
08 decrease and conquer spring 15
 
Principles of functional progrmming in scala
Principles of functional progrmming in scalaPrinciples of functional progrmming in scala
Principles of functional progrmming in scala
 
Chap 3php array part 3
Chap 3php array part 3Chap 3php array part 3
Chap 3php array part 3
 
15_wk4_unsupervised-learning_manifold-EM-cs365-2014.pdf
15_wk4_unsupervised-learning_manifold-EM-cs365-2014.pdf15_wk4_unsupervised-learning_manifold-EM-cs365-2014.pdf
15_wk4_unsupervised-learning_manifold-EM-cs365-2014.pdf
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence
 
Property Based Testing [5] - Software Testing Techniques (CIS640)
Property Based Testing [5] - Software Testing Techniques (CIS640)Property Based Testing [5] - Software Testing Techniques (CIS640)
Property Based Testing [5] - Software Testing Techniques (CIS640)
 
K means
K meansK means
K means
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 

More from Ashwani Jha

MATHEMATICS XI TEST PAPER SOL.pdf
MATHEMATICS XI TEST PAPER SOL.pdfMATHEMATICS XI TEST PAPER SOL.pdf
MATHEMATICS XI TEST PAPER SOL.pdfAshwani Jha
 
PHY XII TEST PAPER.pdf
PHY XII TEST PAPER.pdfPHY XII TEST PAPER.pdf
PHY XII TEST PAPER.pdfAshwani Jha
 
PHY XII TEST PAPERQ.pdf
PHY XII TEST PAPERQ.pdfPHY XII TEST PAPERQ.pdf
PHY XII TEST PAPERQ.pdfAshwani Jha
 
MATHEMATICS XI TEST PAPER.pdf
MATHEMATICS XI TEST PAPER.pdfMATHEMATICS XI TEST PAPER.pdf
MATHEMATICS XI TEST PAPER.pdfAshwani Jha
 
Advanced Support Vector Machine for classification in Neural Network
Advanced Support Vector Machine for classification  in Neural NetworkAdvanced Support Vector Machine for classification  in Neural Network
Advanced Support Vector Machine for classification in Neural NetworkAshwani Jha
 
FEM problem of elasticity
FEM problem of elasticityFEM problem of elasticity
FEM problem of elasticityAshwani Jha
 

More from Ashwani Jha (7)

MATHEMATICS XI TEST PAPER SOL.pdf
MATHEMATICS XI TEST PAPER SOL.pdfMATHEMATICS XI TEST PAPER SOL.pdf
MATHEMATICS XI TEST PAPER SOL.pdf
 
PHY XII TEST PAPER.pdf
PHY XII TEST PAPER.pdfPHY XII TEST PAPER.pdf
PHY XII TEST PAPER.pdf
 
PHY XII TEST PAPERQ.pdf
PHY XII TEST PAPERQ.pdfPHY XII TEST PAPERQ.pdf
PHY XII TEST PAPERQ.pdf
 
MATHEMATICS XI TEST PAPER.pdf
MATHEMATICS XI TEST PAPER.pdfMATHEMATICS XI TEST PAPER.pdf
MATHEMATICS XI TEST PAPER.pdf
 
Advanced Support Vector Machine for classification in Neural Network
Advanced Support Vector Machine for classification  in Neural NetworkAdvanced Support Vector Machine for classification  in Neural Network
Advanced Support Vector Machine for classification in Neural Network
 
FEM problem of elasticity
FEM problem of elasticityFEM problem of elasticity
FEM problem of elasticity
 
Dataset ii ia
Dataset ii iaDataset ii ia
Dataset ii ia
 

K nn