You are on page 1of 10

Lecture 9

Classification
Content

 K Nearest neighbour
KNN Classification
KNN Classification
KNN Classification
KNN Classification
Numerical Example of KNN

 Data from questionair


 Acid durability and strength(two attributes)

Acid durability Strength Classification


7 7 Bad
7 4 Bad
3 4 Good
1 4 Good
Numerical Example of KNN

 Company wants to produce anew tissue paper with Acid durability=3 and
Strength =7
 No Need of Expensive Survey KNN can be used
 Determine the K(number of neighbours)
 Suppose k=3
 Calculate the distance between new instance and all the instances
Numerical Example of KNN

 Query instance=(3,7)

Acid Strength Distance= Rank Classification


durability
7 7 =4 3 Bad
7 4 =5 4 Bad
3 4 =3 1 Good
1 4 =3.60 2 Good

Two neighbours have category is good and only 1 neighbor has category bad
therefore new instance is classified as good.
Thank You

You might also like