Candidate Elimination Algorithm
Candidate Elimination Algorithm
Algorithm
Version space
A version space is a hierarchical representation of knowledge that
enables you to keep track of all the useful information supplied by a
sequence of learning examples without remembering any of the
examples.
The version space method is a concept learning process accomplished
by managing multiple models within a version space.
A hypothesis “h” is consistent with a set of training examples
D of target concept c if and only if h(x) = c(x) for each training
example in D.
The version space VS with respect to hypothesis space H and
training examples D is the subset of hypothesis from H
consistent with all training examples in D.
Version Space Characteristics
Nodes in the specialization tree are connected to a model that matches only one
thing in its subtree.
The key idea in version space learning is that specialization of the general models and
generalization of the specific models may ultimately lead to just one correct model
that matches all observed positive examples and does not match any negative
examples.
Candidate Elimination
Algorithm
Find the maximally general hypothesis and maximally specific hypothesis for the training examples given
in the table using the candidate elimination algorithm.
Step 1:
Initialize G & S as most General and specific hypothesis.
S = {'φ','φ','φ','φ','φ','φ'}
Step 2:
for each +ve example: make a specific hypothesis more general.
s = {'φ','φ','φ','φ','φ','φ'}
Discard the general hypothesis set which is contradicting with a resultant specific hypothesis here
humidity and forecast attribute is contradicting.
G ={<'sunny', '?','?','?', '?','?'> , <'?', 'warm','?','?', '?','?'> }
Find the maximally general hypothesis and maximally specific hypothesis for the training examples given
in the table using the candidate elimination algorithm.
S0: (0, 0, 0, 0, 0) Most Specific Boundary
G0: (?, ?, ?, ?, ?) Most Generic Boundary
S1: (0, 0, 0, 0, 0)
G1: (Many,?,?,?, ?) (?, Big,?,?,?) (?,Medium,?,?,?) (?,?,?,Exp,?) (?,?,?,?,One)
(?,?,?,?,Few)
S2: (Many, Big, No, Exp, Many)
G2: (Many,?,?,?, ?) (?, Big,?,?,?) (?,?,?,Exp,?) (?,?,?,?,Many)
S3: (Many, ?, No, Exp, ?)
G3: (Many,?,?,?,?) (?,?,?,exp,?)
S4: (Many, ?, No, ?, ?)
G4: (Many,?,?,?,?)
Learned Version Space by Candidate Elimination Algorithm for given data set is:
(Many, ?, No, ?, ?) (Many, ?, ?, ?, ?)
Example3:
Find the maximally general hypothesis and maximally specific hypothesis for the training examples given
in the table using the candidate elimination algorithm.
S0: (0, 0, 0) Most Specific Boundary
G0: (?, ?, ?) Most Generic Boundary
S1: (0, 0, 0)
G1: (Small, ?, ?), (?, Blue, ?), (?, ?, Triangle)
S2: (0, 0, 0)
G2: (Small, Blue, ?), (Small, ?, Circle), (?, Blue, ?), (Big, ?, Triangle), (?, Blue, Triangle)
S3: (Small, Red, Circle)
G3: (Small, ?, Circle)
S4: (Small, Red, Circle)
G4: (Small, ?, Circle)
S5: (Small, ?, Circle)
G5: (Small, ?, Circle)
Learned Version Space by Candidate Elimination Algorithm for given data set is:
S: G: (Small, ?, Circle)