Decision Trees - ID3 algorithm with example .ppt

19 views 26 slides Oct 27, 2024
Slide 1
Slide 1 of 26
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26

About This Presentation

Presentation


Slide Content

1
Decision Trees
Greg Grudic
(Notes borrowed from Thomas G. Dietterich and
Tom Mitchell)
Modified by Longin Jan Latecki
Some slides by Piyush Rai
Intro AI Decision Trees

2
Outline
•Decision Tree Representations
–ID3 and C4.5 learning algorithms (Quinlan
1986)
–CART learning algorithm (Breiman et al. 1985)
•Entropy, Information Gain
•Overfitting
Intro AI Decision Trees

3
Training Data Example: Goal is to Predict
When This Player Will Play Tennis?
Intro AI Decision Trees

4Intro AI Decision Trees

5Intro AI Decision Trees

6Intro AI Decision Trees

7Intro AI Decision Trees

8
()( ){ }
1 1
, ,..., ,
N N
S y y=x x
Learning Algorithm for Decision
Trees
( )
{}
1
,...,
, 0,1
d
j
x x
x y
=
Î
x
What happens if features are not binary? What about regression?
Intro AI Decision Trees

9
Choosing the Best Attribute
Intro AI Decision Trees
- Many different frameworks for choosing BEST have been
proposed!
- We will look at Entropy Gain.
Number +
and – examples
before and after
a split.
A1 and A2 are “attributes” (i.e. features or inputs).

10
Entropy
Intro AI Decision Trees

11Intro AI Decision Trees
Entropy is like a measure of impurity…

12
Entropy
Intro AI Decision Trees

Intro AI Decision Trees 13

14
Information Gain
Intro AI Decision Trees

Intro AI Decision Trees 15

Intro AI Decision Trees 16

Intro AI Decision Trees 17

18
Training Example
Intro AI Decision Trees

19
Selecting the Next Attribute
Intro AI Decision Trees

20Intro AI Decision Trees

21
Non-Boolean Features
•Features with multiple discrete values
–Multi-way splits
–Test for one value versus the rest
–Group values into disjoint sets
•Real-valued features
–Use thresholds
•Regression
–Splits based on mean squared error metric
Intro AI Decision Trees

22
Hypothesis Space Search
Intro AI Decision Trees
You do not get the globally
optimal tree!
- Search space is exponential.

23
Overfitting
Intro AI Decision Trees

24
Overfitting in Decision Trees
Intro AI Decision Trees

25
Validation Data is Used to Control
Overfitting
•Prune tree to reduce error on validation set
Intro AI Decision Trees

Homework
•Which feature will be at the root node of the decision tree
trained for the following data? In other words which
attribute makes a person most attractive?
Intro AI Decision Trees 26
Height Hair Eyes Attractive?
small blonde brown No
tall dark brown No
tall blonde blue Yes
tall dark Blue No
small dark Blue No
tall red Blue Yes
tall blonde brown No
small blonde blue Yes
Tags