
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

























1
2
Yes
No
Is X
2
Is X
1
Is X < 6?
1
Is X
2
No Yes
Yes
No No
Yes
Yes
No
Is X
2
< 3?
Is X
1
Is X < 6?
1
< 3?
Is X
2
< 7?
No Yes
Yes
No No
Yes
Each node is based on a feature
At each node, there is a decision
based on the value of the feature
Each leaf is a class (same class
may appear on multiple leaves)
Iris data set
Features Petal Length(PL),
Petal Width (PW)
Petal Length(PL)
Petal Width(PW)
Iris data set
Features Petal Length(PL),
Petal Width (PW)
Is PW < 0.75?
Yes
No
Is PL < 4.45?
Yes
No
Petal Length(PL)
Petal Width(PW)
Iris data set
Features Petal Length(PL),
Petal Width (PW)
Is PW < 0.75?
Yes
No
Is PL < 4.45?
Yes
No
Is PW < 1.75?
Yes
No
Petal Length(PL)
Petal Width(PW)
Draw a decision tree for the following training data set.
Is X
1
Yes
No
Is X
2
Yes
No
Draw a decision tree for the following training data set.
Choose a feature, and a threshold that reduces uncertainty the most
How do we measure uncertainty?
Let X be a random variable(r.v) that takes values v
1
,..,v
k
with
probabilities p
1
,...,p
k
. Then, entropy of X, denoted by H(X), is defined as:
Example:
What is H(X)?
k
i=
i
i
Let X and Z be two random variables. The conditional entropy of X
given Z is defined as:
Essentially, what is the average entropy of X, given that we know Z
z
In-Class Problems:
Let X and Z be two random variables. The conditional entropy of X
given Z is defined as:
Essentially, what is the average entropy of X, given that we know Z
z
Information Gain(Z) = H(X) - H(X|Z)
Root: (5 R, 2 B)
H(X) = -(5/7) log(5/7) - (2/7) log(2/7)
1
2
a
Node a:
Node a
Z = Yes Z = No
H(X|Z=0) = -(2/2) log(2/2) - (0/2) log (0/2)
H(X|Z=1) = -(3/5) log(3/5) - (2/5) log (2/5)
Root: (5 R, 2 B)
1
2
a
b
c d
a: (2 R, 0 B), (3 R, 2 B)
b: (4 R, 0 B), (1 R, 2 B)
c: (5 R, 1 B), (0 R, 1 B)
d: (2 R, 2 B), (3 R, 0 B)
Recall, Information Gain(Z) = H(X) - H(X|Z)
Pick solution b