Professional Documents
Culture Documents
Chapter11 PDF
Chapter11 PDF
Chapter 11
Machine Learning
What is learning?
Machine Learning
What is learning?
That is what learning is. You suddenly understand
something you've understood all your life, but in a
new way.
(Doris Lessing 2007 Nobel Prize in Literature)
Machine Learning
How to construct programs that automatically
improve with experience.
Machine Learning
How to construct programs that automatically
improve with experience.
Learning problem:
Task T
Performance measure P
Training experience E
Machine Learning
Chess game:
Machine Learning
Handwriting recognition:
10
11
12
13
14
15
16
Experiment
Generator
Performance
System
Solution trace
(game history)
Hypothesis
(V^)
Generalizer
Critic
Training examples
{(b1, V1), (b2, V2), ...}
17
18
Example
Experience
Example
Sky
AirTemp
Sunny
Warm
Normal
Strong
Warm
Same
Yes
Sunny
Warm
High
Strong
Warm
Same
Yes
Rainy
Cold
High
Strong
Warm
Change
No
Sunny
Warm
High
Strong
Cool
Change
Yes
Low
Weak
Prediction
Humidity
Wind
Water
Forecast
EnjoySport
Rainy
Cold
High
Strong
Warm
Change
Sunny
Warm
Low
Strong
Cool
Same
Sunny
Warm
Normal
Strong
Warm
Same
19
Example
Learning problem:
20
Concept Learning
Inferring a boolean-valued function from training
examples of its input (instances) and output
(classifications).
21
Concept Learning
Learning problem:
Target function:
Hypothesis:
h: X {0, 1}
22
Concept Learning
Satisfaction:
Consistency:
Correctness:
Concept Learning
How to represent a hypothesis function?
24
Concept Learning
Hypothesis representation (constraints on instance attributes):
<Sky, AirTemp, Humidity, Wind, Water, Forecast>
25
Concept Learning
General-to-specific ordering of hypotheses:
hj g hk iff x
X: hk(x) = 1 hj(x) = 1
Specific
Lattice
(Partial order)
General
h3
h2 = <Sunny, ?, ?,
h3 = <Sunny, ?, ?,
?
?
, ? , ?>
, Cool, ?>
h2
H
26
FIND-S
Example
Sky
AirTemp
Humidity
Wind
Water
Forecast
EnjoySport
Sunny
Warm
Normal
Strong
Warm
Same
Yes
Sunny
Warm
High
Strong
Warm
Same
Yes
Rainy
Cold
High
Strong
Warm
Change
No
Sunny
Warm
High
Strong
Cool
Change
Yes
h=< ,
, ,
>
?
?
? ,
? >
27
FIND-S
Initialize h to the most specific hypothesis in H:
For each positive training instance x:
For each attribute constraint ai in h:
Output hypothesis h
28
AirTemp
FIND-S
Example
Sky
Sunny
Warm
Normal
Strong
Warm
Same
Yes
Sunny
Warm
High
Strong
Warm
Same
Yes
Rainy
Cold
High
Strong
Warm
Change
No
Sunny
Warm
High
Strong
Cool
Change
Yes
h = <Sunny, Warm,
Prediction
Humidity
Wind
, Strong,
Water
? ,
Forecast
? >
Rainy
Cold
High
Strong
Warm
Change
Sunny
Warm
Low
Strong
Cool
Same
Sunny
Warm
Normal
Strong
Warm
EnjoySport
Same
No
Yes
Yes
29
FIND-S
The output hypothesis is the most specific one that
satisfies all positive training examples.
30
FIND-S
The result is consistent with the positive training examples.
31
FIND-S
Is the result is consistent with the negative training
examples?
32
FIND-S
Example
Sky
AirTemp
Sunny
Warm
Normal
Strong
Warm
Same
Yes
Sunny
Warm
High
Strong
Warm
Same
Yes
Rainy
Cold
High
Strong
Warm
Change
No
Sunny
Warm
High
Strong
Cool
Change
Yes
Sunny
Warm
Normal
Strong
Cool
Change
No
h = <Sunny, Warm,
Humidity
Wind
, Strong,
Water
? ,
Forecast
EnjoySport
? >
33
FIND-S
The result is consistent with the negative training examples
if the target concept is contained in H (and the training
examples are correct).
34
FIND-S
The result is consistent with the negative training examples
if the target concept is contained in H (and the training
examples are correct).
Sizes of the space:
FIND-S
Questions:
36
List-then-Eliminate Algorithm
Version space: a set of all hypotheses that are
consistent with the training examples.
Algorithm:
For each training example <x, c(x)>, remove from the version
space any hypothesis h for which h(x) c(x)
Output the hypotheses in the version space
37
List-then-Eliminate Algorithm
Requires an exhaustive enumeration of all hypotheses
in H
38
Compact Representation of
Version Space
G (the generic boundary): set of the most generic
hypotheses of H consistent with the training data D:
G = {g
H | consistent(g, D) g
H: g >g g consistent(g, D)}
Compact Representation of
Version Space
Version space = <G, S> = {h
H | g
G s
S: g g h g s}
S
G
40
Candidate-Elimination Algorithm
Example
Sky
AirTemp
Humidity
Wind
Water
Forecast
Sunny
Warm
Normal
Strong
Warm
Same
Rainy
Cold
High
Strong
Warm
Change
2
4
Sunny
Sunny
Warm
Warm
S0 = {<, , , , , >}
G0 = {<?, ?, ?, ?, ?, ?>}
High
High
Strong
Strong
Warm
Cool
EnjoySport
Yes
Same
Yes
No
Change
Yes
41
Candidate-Elimination Algorithm
S4 = {<Sunny, Warm, ?, Strong, ?, ?>}
42
Candidate-Elimination Algorithm
Initialize G to the set of maximally general hypotheses
in H
Initialize S to the set of maximally specific hypotheses
in H
43
Candidate-Elimination Algorithm
For each positive example d:
44
Candidate-Elimination Algorithm
For each negative example d:
45
Candidate-Elimination Algorithm
The version space will converge toward the correct
target concepts if:
H contains the correct target concept
There are no errors in the training examples
46
Candidate-Elimination Algorithm
Partially learned concept can be used to classify new
instances using the majority rule.
S4 = {<Sunny, Warm, ?, Strong, ?, ?>}
Rainy
Warm
High
Strong
Cool
Same
?
47
Inductive Bias
Size of the instance space: |X| = 3.2.2.2.2.2 = 96
Number of possible concepts = 2|X| = 296
Size of H = (4.3.3.3.3.3) + 1 = 973 << 296
48
Inductive Bias
Size of the instance space: |X| = 3.2.2.2.2.2 = 96
Number of possible concepts = 2|X| = 296
Size of H = (4.3.3.3.3.3) + 1 = 973 << 296
a biased hypothesis space
49
Inductive Bias
An unbiased hypothesis space H that can represent
every subset of the instance space X: Propositional
logic sentences
Positive examples: x1, x2, x3
Negative examples: x4, x5
h(x) (x = x1) (x = x2) (x = x3) x1 x2 x3
h(x) (x x4) (x x5) x4 x5
50
Inductive Bias
x1 x2 x3
x1 x2 x3 x6
x4 x5
Any new instance x is classified positive by half of the version space,
and negative by the other half
not classifiable
51
Example
Inductive Bias
Day
Actor
Mon
Famous
Sun
Infamous
2
4
5
6
7
8
9
10
Sat
Wed
Sun
Thu
Tue
Sat
Wed
Sat
Price
EasyTicket
Expensive
Yes
Cheap
No
Famous
Moderate
Infamous
Moderate
Yes
Cheap
Yes
Cheap
No
Famous
Infamous
Famous
Famous
Famous
Infamous
Expensive
Expensive
Cheap
Expensive
No
No
Yes
?
52
Inductive Bias
Example
Quality
Price
Buy
Good
Low
Yes
Bad
High
No
Good
High
Bad
Low
53
Inductive Bias
A learner that makes no prior assumptions regarding
the identity of the target concept cannot classify any
unseen instances.
54
Homework
Exercises
55