Machine Learning
Chapter 11
CuuDuongThanCong.com
/>
Machine Learning
• What is learning?
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
2
15 November 2011
/>
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)
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
3
15 November 2011
/>
Machine Learning
• Arthur Samuel (1959):
"Field of study that gives computers the ability to
learn without being explicitly programmed”.
• Tom Mitchell (1997):
"A computer program is said to learn from experience
E with respect to some class of tasks T and
performance measure P, if its performance at tasks in
T, as measured by P, improves with experience E”.
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
4
15 November 2011
/>
Machine Learning
• How to construct programs that automatically improve
with experience.
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
5
15 November 2011
/>
Machine Learning
• How to construct programs that automatically improve
with experience.
• Learning problem:
– Task T
– Performance measure P
– Training experience E
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
6
15 November 2011
/>
Machine Learning
• Chess game:
– Task T: playing chess games
– Performance measure P: percent of games won against
opponents
– Training experience E: playing practice games againts itself
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
7
15 November 2011
/>
Machine Learning
• Handwriting recognition:
– Task T: recognizing and classifying handwritten words
– Performance measure P: percent of words correctly
classified
– Training experience E: handwritten words with given
classifications
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
8
15 November 2011
/>
Example
Experience
Example
GRAY?
MAMMAL? LARGE? VEGETARIAN? WILD?
Elephant
1
+
+
+
+
+
+
2
+
+
+
-
+
+
3
+
+
-
+
+
- (Mouse)
4
-
+
+
+
+
- (Giraffe)
5
+
-
+
-
+
- (Dinosaur)
6
+
+
+
+
-
+
Prediction
7
+
+
+
-
+
?
8
+
-
+
-
+
?
9
+
+
+
-
-
?
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
9
15 November 2011
/>
Example
Experience
Example
Sky
AirTemp
1
Sunny
Warm
Normal
Strong
Warm
Same
Yes
2
Sunny
Warm
High
Strong
Warm
Same
Yes
3
Rainy
Cold
High
Strong
Warm
Change
No
4
Sunny
Warm
High
Strong
Cool
Change
Yes
Low
Weak
Prediction
Humidity
Wind
Water
Forecast
EnjoySport
5
Rainy
Cold
High
Strong
Warm
Change
?
6
Sunny
Warm
Normal
Strong
Warm
Same
?
7
Sunny
Warm
Low
Strong
Cool
Same
?
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
10
15 November 2011
/>
Machine Learning
Training
Testing
Applying
Training
Data
Testing
Data
Real
Data
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
11
15 November 2011
/>
Machine Learning
• What is learning?
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
12
15 November 2011
/>
Machine Learning
• What is learning?
Experience
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
Learner
Hypothesis
13
15 November 2011
/>
Machine Learning
• Learning is an (endless) generalization or induction
process.
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
14
15 November 2011
/>
Machine Learning
• Supervised learning: the learner (learning algorithm)
are trained on labelled examples, i.e., input where the
desired output is known.
• Unsupervised learning: the learner operates on
unlabelled examples, i.e., input where the desired
output is unknown.
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
15
15 November 2011
/>
Concept Learning
• Inferring a boolean-valued function from training
examples of its input (instances) and output
(classifications).
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
16
15 November 2011
/>
Concept Learning
• Learning problem:
– Target concept: a subset of the set of instances X
c: X → {0, 1}
– Target function:
Sky × AirTemp × Humidity × Wind × Water × Forecast → {0, 1}
– Hypothesis:
Characteristics of all instances of the concept to be learned
≡ Constraints on instance attributes
h: X → {0, 1}
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
17
15 November 2011
/>
Concept Learning
• Satisfaction:
h(x) = 1 iff x satisfies all the constraints of h
h(x) = 0 otherwsie
• Consistency:
h(x) = c(x) for every instance x of the training examples
• Correctness:
h(x) = c(x) for every instance x of X
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
18
15 November 2011
/>
Concept Learning
• How to represent a hypothesis?
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
19
15 November 2011
/>
Concept Learning
• Hypothesis representation (constraints on instance attributes):
<Sky, AirTemp, Humidity, Wind, Water, Forecast>
– ?: any value is acceptable
– single required value
– ∅: no value is acceptable
• Example:
h1 = <Sunny, ?, ?, Strong, ? , ?>
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
20
15 November 2011
/>
Concept Learning
• General-to-specific ordering of hypotheses:
hj ≥g hk iff ∀x∈X: hk(x) = 1 ⇒ hj(x) = 1
Specific
h1 = <Sunny, ?, ?, Strong, ? , ?>
h1
h3
Lattice
(Partial order)
General
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
h2 =
?
, ? , ?>
h3 =
?
, Cool, ?>
h2
H
21
15 November 2011
/>
Concept Learning
Example
Sky
AirTemp
Humidity
Wind
Water
Forecast
EnjoySport
1
Sunny
Warm
Normal
Strong
Warm
Same
Yes
2
Sunny
Warm
High
Strong
Warm
Same
Yes
3
Rainy
Cold
High
Strong
Warm
Change
No
4
Sunny
Warm
High
Strong
Cool
Change
Yes
What is a hypothesis that is consistent with the
training examples?
h=<_,_,_,_,_,_>
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
22
15 November 2011
/>
Concept Learning
Example
Sky
AirTemp
Humidity
Wind
Water
Forecast
EnjoySport
1
Sunny
Warm
Normal
Strong
Warm
Same
Yes
2
Sunny
Warm
High
Strong
Warm
Same
Yes
3
Rainy
Cold
High
Strong
Warm
Change
No
4
Sunny
Warm
High
Strong
Cool
Change
Yes
What is the most specific hypothesis that is consistent
with the training examples?
h=<_,_,_,_,_,_>
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
23
15 November 2011
/>
FIND-S
Example
Sky
AirTemp
Humidity
Wind
Water
Forecast
EnjoySport
1
Sunny
Warm
Normal
Strong
Warm
Same
Yes
2
Sunny
Warm
High
Strong
Warm
Same
Yes
3
Rainy
Cold
High
Strong
Warm
Change
No
4
Sunny
Warm
High
Strong
Cool
Change
Yes
h=< ∅ ,
∅ ,
∅ ,
∅ , ∅ ,
∅ >
h = <Sunny, Warm, Normal, Strong, Warm, Same>
h =
?
, Strong, Warm, Same>
h =
?
, Strong,
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
? ,
? >
24
15 November 2011
/>
FIND-S
• Initialize h to the most specific hypothesis in H:
• For each positive training instance x:
For each attribute constraint ai in h:
If the constraint is not satisfied by x
Then replace ai by the next more general
constraint satisfied by x
• Output hypothesis h
Cao Hoang Tru
CSE Faculty - HCMUT
CuuDuongThanCong.com
25
15 November 2011
/>