Vous êtes sur la page 1sur 18

Induction of Decision Trees

Induction of Decision Trees


Data Set (Learning Set)
Each example = Attributes + Class

Induced description = Decision tree


TDIDT
Top Down Induction of Decision Trees

Recursive Partitioning

Example 2

Simple Tree
Outlook
sunny

overcast

Humidity
high

rainy

Windy

normal

yes

no

Information-Theoretic Approach
To classify an object, a certain information is
needed
I, information

After we have learned the value of attribute A,


we only need some remaining amount of
information to classify the object
Ires, residual information

Gain
Gain(A) = I Ires(A)

The most informative attribute is the one that


minimizes Ires, i.e., maximizes Gain

Entropy
The average amount of information I needed to
classify an object is given by the entropy measure

For a two-class problem:


entropy

p(c1)

Residual Information
After applying attribute A, S is partitioned
into subsets according to values v of A
Ires is equal to weighted sum of the
amounts of information for the subsets

Triangles and Squares


#
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Color
green
green
yellow
red
red
red
green
green
yellow
red
green
yellow
yellow
red

Attribute
Outline
dashed
dashed
dashed
dashed
solid
solid
solid
dashed
solid
solid
solid
dashed
solid
dashed

Shape
Dot
no
yes
no
no
no
yes
no
no
yes
no
yes
yes
no
yes

triange
triange
square
square
square
triange
square
triange
square
square
square
square
square
triange

Triangles and Squares


#
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Color
green
green
yellow
red
red
red
green
green
yellow
red
green
yellow
yellow
red

Attribute
Outline
dashed
dashed
dashed
dashed
solid
solid
solid
dashed
solid
solid
solid
dashed
solid
dashed

Shape
Dot
no
yes
no
no
no
yes
no
no
yes
no
yes
yes
no
yes

triange
triange
square
square
square
triange
square
triange
square
square
square
square
square
triange

Data Set:
A set of classified objects
.

Entropy
.

5 triangles
9 squares
class probabilities
.

entropy

Entropy
reduction
by
data set
partitioning

.
.

red

Color?

green

.
yellow

.
.

.
.

.
.

.
.

red

Color?

green
yellow

.
.

Information Gain

.
.

.
.

.
.

red

Color?

green
yellow

.
.

Information Gain of The Attribute


Attributes
Gain(Color) = 0.246
Gain(Outline) = 0.151
Gain(Dot) = 0.048

Heuristics: attribute with the highest gain is


chosen
This heuristics is local (local minimization of
impurity)

red

Color?
green

.
.

yellow

.
.

Gain(Outline) = 0.971 0 = 0.971 bits


Gain(Dot) = 0.971 0.951 = 0.020 bits

red

Gain(Outline) = 0.971 0.951 = 0.020 bits


Gain(Dot) = 0.971 0 = 0.971 bits

Color?
green

.
.

yellow

.
.
solid

Outline?
dashed

red

yes

Dot?

Color?

no
green

.
.

yellow

.
.
solid

Outline?
dashed

Decision Tree
.

Color
red

Dot
yes

triangle

yellow

green

square
no

square

Outline
dashed

triangle

solid

square

Vous aimerez peut-être aussi