Machine Learning in Real World:�C4.5
Outline
2
Industrial-strength algorithms
3
C4.5 History
4
Numeric attributes
5
Weather data – nominal values
6
Outlook | Temperature | Humidity | Windy | Play |
Sunny | Hot | High | False | No |
Sunny | Hot | High | True | No |
Overcast | Hot | High | False | Yes |
Rainy | Mild | Normal | False | Yes |
… | … | … | … | … |
If outlook = sunny and humidity = high then play = no If outlook = rainy and windy = true then play = no If outlook = overcast then play = yes If humidity = normal then play = yes If none of the above then play = yes |
Weather data - numeric
7
Outlook | Temperature | Humidity | Windy | Play |
Sunny | 85 | 85 | False | No |
Sunny | 80 | 90 | True | No |
Overcast | 83 | 86 | False | Yes |
Rainy | 75 | 80 | False | Yes |
… | … | … | … | … |
If outlook = sunny and humidity > 83 then play = no If outlook = rainy and windy = true then play = no If outlook = overcast then play = yes If humidity < 85 then play = yes If none of the above then play = yes |
Example
8
64 65 68 69 70 71 72 72 75 75 80 81 83 85 Yes No Yes Yes Yes No No Yes Yes Yes No Yes Yes No |
Avoid repeated sorting!
9
More speeding up
10
64 65 68 69 70 71 72 72 75 75 80 81 83 85 Yes No Yes Yes Yes No No Yes Yes Yes No Yes Yes No |
Potential optimal breakpoints
Breakpoints between values of the same class cannot
be optimal
value
class
X
X
Binary vs. multi-way splits
11
Missing as a separate value
12
Missing values - advanced
Split instances with missing values into pieces
13
Pruning
14
Prepruning
15
Early stopping
16
| a | b | class |
1 | 0 | 0 | 0 |
2 | 0 | 1 | 1 |
3 | 1 | 0 | 1 |
4 | 1 | 1 | 0 |
|
Post-pruning
17
Subtree replacement, 1
18
Subtree replacement, 2
What subtree can we replace?
19
Subtree�replacement, 3
20
*Subtree raising
(Worthwhile?)
21
X
Estimating error rates
22
*Mean and variance
23
*Confidence limits
24
Pr[X ≥ z] | z |
0.1% | 3.09 |
0.5% | 2.58 |
1% | 2.33 |
5% | 1.65 |
10% | 1.28 |
20% | 0.84 |
25% | 0.69 |
40% | 0.25 |
–1 0 1 1.65
*Transforming f
25
C4.5’s method
26
Example
27
f=0.33 e=0.47
f=0.5 e=0.72
f=0.33 e=0.47
f = 5/14 �e = 0.46�e < 0.51�so prune!
Combined using ratios 6:2:6 gives 0.51
*Complexity of tree induction
28
From trees to rules – how?
How can we produce a set of rules from a decision tree?
29
From trees to rules – simple
30
C4.5rules: choices and options
31
*Classification rules
32
*Test selection criteria
33
*Missing values,�numeric attributes
34
*Pruning rules
35
Summary
36