0% found this document useful (0 votes)
124 views2 pages

Candidate Elimination

The Candidate Elimination Algorithm computes the version space containing all hypotheses from the hypothesis space H that are consistent with the training examples. It initializes with general hypotheses in G and specific hypotheses in S. For each training example, it eliminates inconsistent hypotheses from G and S, and adds generalizations of S and specializations of G to the respective sets.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views2 pages

Candidate Elimination

The Candidate Elimination Algorithm computes the version space containing all hypotheses from the hypothesis space H that are consistent with the training examples. It initializes with general hypotheses in G and specific hypotheses in S. For each training example, it eliminates inconsistent hypotheses from G and S, and adds generalizations of S and specializations of G to the respective sets.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CLICK HERE TO GET MORE FREE SOLUTIONS

:: Solution ::

Candidate Elimination Algorithm:


The candidate-Elimination algorithm computes the version space containing all (and only those) hypotheses from H that are consistent with

For each training example d, do:


If d is positive example
Remove from G any hypothesis h inconsistent with d
For each hypothesis s in S not consistent with d:
Remove s from S
Add to S all minimal generalizations of s consistent with d and having a generalization in G
Remove from S any hypothesis with a more specific h in S
If d is negative example
Remove from S any hypothesis h inconsistent with d
For each hypothesis g in G not consistent with d:
Remove g from G
Add to G all minimal specializations of g consistent with d and having a specialization in S
Remove from G any hypothesis having a more general hypothesis in G

Terms used:

Concept Learning: It is the learning task of the machine

General Hypothesis: It is not specifying the featurees of the machine.

G={'?', '?', '?', '?', '?'.....}: The number of attributes

Specific Hypothesis: It specifies features to make the machine learn.

S={'p', 'p', 'p',...}: Number of p depends on number of attributes.

Version Space: It is intermediate of general hypothesis and specific hypothesis. The version space which is denoted by VSH,D with respect to
hypothesis space H and training examples D, is the subset of hypothesis H consistent with training examples in D.

From the given dataset, the Candidate Elimination Algorithm works this way:

Initially : G = [[?, ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?, ?], [?, ?

S = [ Null, Null, Null, Null, Null, Null, Null ]

For instance 1 : < 'Germany', 'BMW', '545i', '2005', 'black', '325hp', 'sedan'> and positive output

G1 = G

S1 = [ 'Germany', 'BMW', '545i', '2005', 'black', '325hp', 'sedan']

For instance 2: < 'Germany', 'Mercedes-Benz', 'SL500', '2005', 'black', '302hp', 'roadster'> and positive output

G2=G
S2 = [ 'Germany', ?, ?, '2005', 'black', ?, ?]

For instance 3: < 'Japan', 'Toyota', 'Camry', '2000', 'white', '160hp', 'sedan' > and negative output

G3 = [[ 'Germany',?,?,?,?,?,?], [?, ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?, ?], [?, ?, ?, '2005', ?, ?, ?], [?, ?, ?, ?, 'black', ?, ?], [?

S3 = S2

Instance 4: < 'Germany', 'Porsche', 'C240', '2000', 'black', '168hp', 'wagon'> and positive output

G4 = G3

S4 = ['Germany', ?, ?, ?, 'black', ?, ?]

Instance 5: < 'USA', 'Ford', 'Focus', '2000', 'green', '130hp', 'sedan'> and negative output

G5 = [['Germany', ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, 'black', ?, ?], [?

S5 = S4

So, by synchronizing the G5 and S5 algorithm produce the output.

Output:

G = [['Germany', ?, ?, ?, ?, ?, ?], [?, ?, ?, ?, 'black', ?, ?]]

S = ['Germany', ?, ?, ?, 'black', ?, ?]

Please upvote and if you have any doubt do comment.!

Likes: 0

Dislikes: 0

You might also like