ML Module 5 1
ML Module 5 1
2
Module-V Chapter 8
Instance Based Learning,
By
Pramod Kumar PM
Vivekananda College of Engineering
Technology, Puttur
Module 5 - Outline
4
Introduction
5
Introduction
6
Module 5 - Outline
7
K-nearest neighbor learning
(For classification and regression)
8
K-nearest neighbor learning
9
KNN Algorithm for classification
10
▪ Step-1: Select the number K of the neighbors
▪ Step-2: Calculate the Euclidean distance of K number of
neighbors
▪ Step-3: Take the K nearest neighbors as per the calculated
Euclidean distance.
▪ Step-4: Among these k neighbors, count the number of the
data points in each category.
▪ Step-5: Assign the new data points to that category for which
the number of the neighbor is maximum.
▪ Step-6: Our model is ready.
11
Height (in cms) Weight (in kgs) T Shirt Size
160 59 M
160 60 M
163 60 M
163 61 M
160 64 L
163 64 L 161 61
165 61 L
165 62 L
12
13
14
15
K-NN Hypothesis Space
16
K-nearest neighbor learning
17
Distance Weighted Nearest Neighbor
18
Remarks on K-NN
19
Module 5 - Outline
20
Locally Weighted Regression
21
22
Locally weighted linear regression
23
Locally weighted linear regression
24
Locally weighted linear regression
25
Algorithm
26
Module 5 - Outline
27
Radial basis function
28
Radial basis function
( for regression)
29
Radial basis function
30
RBF NN
31
Module 5 - Outline
34
Case Based Reasoning
▪ Instance-based methods such as k-NN, locally weighted
regression share three key properties.
1. They are lazy learning methods
They defer the decision of how to generalize beyond the
training data until a new query instance is observed.
2. They classify new query instances by analyzing similar
instances while ignoring instances that are very different
from the query.
3. Third, they represent instances as real-valued points in
an n-dimensional Euclidean space.
▪ Case-based reasoning (CBR) is a learning paradigm based on
the first two of these principles, but not the third.
35
Case Based Reasoning
▪ In CBR, instances are typically represented using more rich
symbolic descriptions, and the methods used to retrieve
similar instances are correspondingly more elaborate.
• CBR has been applied to problems such as conceptual
design of mechanical devices based on a stored library of
previous designs (Sycara et al. 1992),
• reasoning about new legal cases based on previous rulings
(Ashley 1990),
• solving planning and scheduling problems by reusing and
combining portions of previous solutions to similar
problems (Veloso 1992).
36
"+" label indicates that
the variable
“ at the arrowhead increases with the variable at its tail
-" label indicates that the variable at the head decreases with the variable at
the tail
37
Case Study
▪ The CADET system (Sycara et al. 1992)
• employs case based reasoning to assist in the conceptual
design of simple mechanical devices such as water faucets.
• It uses a library containing approximately 75 previous
designs and
• design fragments to suggest conceptual designs to meet
the specifications of new design problems.
38
Summary
39