Instance Based Learning: Aiml/ Bda
Instance Based Learning: Aiml/ Bda
AIML/ BDA
Topics covered
• K-Nearest Neighbors (K-NN) concept
• Distance metrics
• K-NN for classification
Machine Learning Classification
• Training instances are stored in memory
Instances • For a test (unseen) instances
Based Learning • Compare test instances with instances seen in training and
gives result
• Also known as Memory based learning
Disadvantage:
• The cost of classifying new instances - high.
• Considered all attributes of the instances – dimension increase
Comparison
Example
• A company produce tissues (used by biological labs).
instance - xq +
1.00 + +
-
1.35 - +
1.40 -
1.60 -
1.90 + 1-NN +
2.00 +
2.20 - 3-NN -
2.40 +
2.80 - 5-NN -
7-NN -
Selection of K value ?
• Try many different values for K and see what works best for your
problem.
• K value should be an odd number (3, 5, 7, 9, etc.).
How does the efficiency and accuracy of k-NN search
change as k increases?
• If we have sufficiently large number of training experiences the
accuracy should increase
• The computational complexity of KNN increases with the size of the
training dataset.
• The time to calculate the prediction will also increase.
• In that sense less efficient
• KNN is a Lazy Learning algorithm – why?