Professional Documents
Culture Documents
Concept Learning and Genrel To Specific Ordering - 2
Concept Learning and Genrel To Specific Ordering - 2
Concept Learning and Genrel To Specific Ordering - 2
the General-to-Specific
Ordering
Concept Learning
• Learn the "days on which my friend Aldo enjoys his favorite water
sport“
3
A Concept Learning Task
• Target Concept
• “days on which Aldo enjoys water sport”
• Hypothesis
• vector of 6 constraints (Sky, AirTemp, Humidity, Wind, Water, Forecast,
EnjoySport )
• Each attribute (“?”, single value or “Ø”)
• e.g. <?, Cold, High, ?, ?, ?>
5
Hypothesis
•The most general hypothesis- that every day is positive
example is represented by
<?, ?, ?, ?, ?, ?>
•The most specific possible hypothesis-that no day is a
positive example-is represented by –
< Ø, Ø, Ø, Ø, Ø, Ø >
10
Concept Learning As Search
• Search through a large space of hypothesis implicitly defined by the
hypothesis representation
• Find the hypothesis that best fits the training examples
• How big is the hypothesis space?
• Given that the attribute Sky has three possible values, and that
AirTemp, Humidity, Wind, Water, and Forecast each have two
possible values, the instance space X contains exactly 3 .2.2 .2.2 .2 =
96 distinct instances.
• A similar calculation shows that there are 5.4.4.4.4.4 = 5120
syntactically distinct hypotheses within H.
• Every hypothesis containing one or more " Ø " symbols represents
the empty set of instances; that is, it classifies every instance as
negative. Therefore, the number of semantically distinct hypotheses
is only 1 + (4.3.3.3.3.3) = 973.
11
General to Specific Ordering
• This hypothesis is the most general hypothesis. It
represents the idea that every day is a positive example:
hg = <?, ?, ?, ?, ?, ?>
12
General to Specific Ordering
• This hypothesis is the most general hypothesis. It
represents the idea that every day is a positive example:
hg = <?, ?, ?, ?, ?, ?>
• The following hypothesis is the most specific
hypothesis: it says that no day is a positive example:
hs = <Ø, Ø, Ø, Ø, Ø, Ø>
13
General to Specific Ordering
• We can define a partial order over the set of hypotheses:
h1 >g h2
• This states that h1 is more general than h2
• Let h1 = <Sunny, ?, ?, ?, ?, ?>
• Let h2 = <Sunny, ?, ?, Strong, ?, ?>
14
General to Specific Ordering
• We can define a partial order over the set of hypotheses:
h1 >g h2
• This states that h1 is more general than h2
• Let h1 = <Sunny, ?, ?, ?, ?, ?>
• Let h2 = <Sunny, ?, ?, Strong, ?, ?>
• Given hypothesis hj and hk, hj is
more_general_than_or_equal_to hk if and only if any
instance that satisfies hk also satisfies hj
• One learning method is to determine the most specific
hypothesis that matches all the training data.
15
General to Specific Ordering
Partial Ordering
Instances X Hypotheses H
Specific
h1 h3
x1
h2
x2
General
17
Find-S: Finding a maximally Specific
Hypothesis
1. Initialize h to the most specific hypothesis in H
2. For each positive training instance x
• For each attribute constraint ai in h
• If the constraint ai is satisfied by x
• Then do nothing
• Else replace ai in h by the next more general constraint that is
satisfied by x
3. Output hypothesis h
18
Find-S: Finding a maximally Specific
Hypothesis
• Begin: h ← <Ø, Ø, Ø, Ø, Ø, Ø>
19
Find-S: Finding a maximally Specific Hypothesis
Instances X Hypotheses H
specific
general
h0=〈∅ ∅ ∅ ∅ ∅ ∅〉
x1=〈Sunny Warm Normal Strong Warm Same〉 + h1=〈Sunny Warm Normal Strong Warm Same〉
x2=〈Sunny Warm High Strong Warm Same〉 + h2=〈Sunny Warm ? Strong Warm Same〉
x3=〈Rainy Cold High Strong Warm Change〉 − h3=〈Sunny Warm ? Strong Warm Same〉
x4=〈Sunny Warm High Strong Cool Change〉 + h4=〈Sunny Warm ? Strong ? ?〉
Example: Find a specific Hypothesis
Limitations of Find-S Algorithm
There are a few limitations of the Find-S algorithm
listed down below:
23
Consistent Hypotheses and Version
Space
•A hypothesis h is consistent with a set of training
examples D of target concept c
if h(x) = c(x) for each training example 〈x, c(x)〉 in D
•Note that consistency is with respect to specific D.
•Notation:
Consistent (h, D) ≡ ∀〈x, c(x)〉∈D :: h(x) = c(x)
•The version space, VSH,D , with respect to hypothesis
space H and training examples D, is the subset of
hypotheses from H consistent with D
•Notation:
VSH,D = {h | h ∈ H ∧ Consistent (h, D)}
24
Consistent Hypotheses and Version
Space
Example Citations Size In Library Price Edition Buy
1 Some Small No Affordable One No
27
Candidate Elimination Algorithm
29
Version Spaces and the
Candidate-Elimination Algorithm(3)
Version Spaces and the
Candidate-Elimination Algorithm(6)
•Illustrative Example
Version Spaces and the
Candidate-Elimination Algorithm(7)
Version Spaces and the
Candidate-Elimination Algorithm(8)
Version Spaces and the
Candidate-Elimination Algorithm(9)
Example on Candidate Elimination Algorithm
• S1: (0, 0, 0, 0, 0)
• G1: (Many,?,?,?, ?) (?, Big,?,?,?) (?,Medium,?,?,?) (?,?,?,Exp,?)
(?,?,?,?,One) (?,?,?,?,Few)