Árbol de decisión
(DataSet)
Outlook
Temp
Humidity
Windy
Class
sunny
hot
high
false
Don't Play
sunny
hot
high
true
Don't Play
overcast
hot
high
false
Play
rainy
mild
high
false
Play
rainy
cool
normal
false
Play
rainy
cool
normal
true
Don’t Play
overcast
cool
normal
true
Play
sunny
mild
high
false
Don’t Play
sunny
cool
normal
false
Play
rainy
mild
normal
false
Play
sunny
mild
normal
true
Play
overcast
mild
high
true
Play
overcast
hot
normal
false
Play
rainy
mild
high
true
Don’t Play
Árbol de decisión
(Fórmulas)
c
Entropy ( S ) 

p i log
2
pi
i 1

Gain ( S , A )  Entropy ( S ) 
Sv
S
Entropy (S v )
vValores ( A )
c
SplitInfor mation ( S , A ) 

Si
S
log
Si
2
S
i 1
GainRatio ( S , A ) 
Gain ( S , A )
SplitInfor mation ( S , A )
Gain-ratio
Mutual-info
Árbol de decisión
(Algoritmo)
Árbol de decisión
(Construcción – nivel1)
2
Entropy ([ 9 Play ,5 Don 'tPlay ]) 
p
i
log
2
pi 
i 1
  p Play log
  149 log
2
9
2 14
p Play  p Don 'tPlay log

5
14
log
5
2 14
2
p Don 'tPlay 
 0 ,94
Gain ([ 9 Play ,5 Don 'tPlay ], Outlook ) 

 Entropy ([ 9 Play ,5 Don 'tPlay ]) 
Sv
S
Entropy ( S v ) 
v { sunny , overcat , rainy }
 0 ,94 
5
14
Entropy ( S sunny ) 
4
14
Entropy ( S overcast ) 
5
14
Entropy ( S sunny )  Entropy ([ 2 Play ,3 Don 'tPlay ])   52 log
Entropy ( S rainy )  ...
2
2 5
Entropy ( S overcast )  Entropy ([ 4 Play , 0 Don 'tPlay ])   44 log
Entropy ( S rainy )  Entropy ([ 3 Play , 2 Don 'tPlay ])   53 log
 53 log
4
2 4

0
4

2
5
log
3
2 5
3
2 5
log
 0,971
0
2 4
2
2 5
0
 0,971
Árbol de decisión
(Construcción – nivel1)
Gain ([ 9 Play ,5 Don 'tPlay ], Outlook )  ... 
 0 ,94 
5
14
Entropy ( S sunny ) 
 0 ,94 
5
14
 0,971 
4
14
0 
5
14
4
14
Entropy ( S overcast ) 
5
14
Entropy ( S rainy ) 
 0,971  0,247
Gain ([ 9 Play ,5 Don 'tPlay ], Temp ) 
 Entropy ([ 9 Play ,5 Don 'tPlay ]) 

Sv
S
Entropy ( S v ) 
v{ hot , mild , cool }
 0 ,94 
4
14
Entropy ( S hot ) 
6
14
Entropy ( S mild ) 
4
14
Entropy ( S cool )  ...
Entropy ( S hot )  Entropy ([ 2 Play , 2 Don 'tPlay ])   24 log
Entropy ( S mild )  Entropy ([ 4 Play , 2 Don 'tPlay ])   64 log
Entropy ( S cool )  Entropy ([ 3 Play ,1 Don 'tPlay ])   34 log
2
2 4

4
2 6
3
2 4
2
4


log
2
6
1
4
log
log
2
2 4
2
2 6
1
2 4
1
 0,918
 0,811
Árbol de decisión
(Construcción – nivel1)
Gain ([ 9 Play ,5 Don 'tPlay ], Temp )  0 ,94 
4
14
1 
6
14
 0 ,918 
4
14
 0 ,811  0,029
Gain ([ 9 Play , 5 Don 'tPlay ], Humidity ) 
 Entropy ([ 9 Play ,5 Don 'tPlay ]) 

Sv
S
Entropy ( S v ) 
v { high , normal }
 0 , 94 
7
14
Entropy ( S high ) 
7
14
Entropy ( S normal )  ...
Entropy ( S high )  Entropy ([ 3 Play , 4 Don 'tPlay ])   73 log
3
2 7
Entropy ( S normal )  Entropy ([ 6 Play ,1 Don 'tPlay ])   76 log
Gain ([ 9 Play ,5 Don 'tPlay ], Humidity )  0 ,94 
7
14
 0 ,985 

6
2 7
7
14
4
7

log
1
7
4
2 7
log
 0,985
1
2 7
 0,592
 0 ,592  0,151
Árbol de decisión
(Construcción – nivel1)
Gain ([ 9 Play ,5 Don 'tPlay ], Windy ) 
 Entropy ([ 9 Play ,5 Don 'tPlay ]) 

Sv
S
Entropy ( S v ) 
v { true , false }
 0 ,94 
6
14
Entropy ( S true ) 
8
14
Entropy ( S false )  ...
Entropy ( S true )  Entropy ([ 3 Play ,3 Don 'tPlay ])   63 log
3
2 6
Entropy ( S false )  Entropy ([ 6 Play , 2 Don 'tPlay ])   86 log
Gain ([ 9 Play ,5 Don 'tPlay ], Windy )  0 ,94 
6
14
1 
8
14

6
2 8
3
6

log
2
8
3
2 6
log
 0 ,811  0,048
1
2
2 8
 0,811
Árbol de decisión
(Construcción – nivel1)
Gain ([ 9 Play ,5 Don 'tPlay ], Outlook )  0,247
Gain ([ 9 Play ,5 Don 'tPlay ], Temp )  0,029
Gain ([ 9 Play ,5 Don 'tPlay ], Humidity )  0,151
Gain ([ 9 Play ,5 Don 'tPlay ], Windy )  0,048
Árbol de decisión
(Construcción – nivel2)
Outlook
Temp
Humidity
Windy
Class
sunny
hot
high
false
Don't Play
sunny
hot
high
true
Don't Play
sunny
mild
high
false
Don’t Play
sunny
cool
normal
false
Play
sunny
mild
normal
true
Play
Entropy ([ 2 Play ,3 Don 'tPlay ])  0,971
Gain ([ 2 Play ,3 Don 'tPlay ], Temp ) 
 Entropy ([ 2 Play ,3 Don 'tPlay ]) 

Sv
S
Entropy ( S v ) 
v{ hot , mild , cool }
 0 ,971 
2
5
Entropy ( S hot ) 
2
5
Entropy ( S mild ) 
1
5
Entropy ( S cool )  ...
Árbol de decisión
(Construcción – nivel2)
Entropy ( S hot )  Entropy ([ 0 Play , 2 Don 'tPlay ])  0
Entropy ( S mild )  Entropy ([ 1 Play ,1 Don 'tPlay ])  1
Entropy ( S cool )  Entropy ([ 1 Play , 0 Don 'tPlay ])  0
Gain ([ 2 Play ,3 Don 'tPlay ], Temp )  0 ,971 
2
5
0 
2
5
 1  15  0  0,57
Gain ([ 2 Play ,3 Don 'tPlay ], Humidity ) 
 Entropy ([ 2 Play , 3 Don 'tPlay ]) 

Sv
S
Entropy ( S v ) 
v { high , normal }
 0 , 971 
3
5
Entropy ( S high ) 
2
5
Entropy ( S normal )  ...
Entropy ( S high )  Entropy ([ 0 Play ,3 Don 'tPlay ])  0
Entropy ( S normal )  Entropy ([ 2 Play , 0 Don 'tPlay ])  0
Árbol de decisión
(Construcción – nivel2)
Gain ([ 2 Play ,3 Don 'tPlay ], Humidity )  0 ,971  53  0 
2
5
 0  0 ,971
Gain ([ 2 Play , 3 Don 'tPlay ], Windy ) 
 Entropy ([ 2 Play , 3 Don 'tPlay ]) 

Sv
S
Entropy ( S v ) 
v { true , false }
 0 ,971 
2
5
Entropy ( S true ) 
3
5
Entropy ( S false )  ...
Entropy ( S true )  Entropy ([ 1 Play ,1 Don 'tPlay ])  1
Entropy ( S false )  Entropy ([ 1 Play , 2 Don 'tPlay ])   13 log
Gain ([ 2 Play ,3 Don 'tPlay ], Windy )  0 ,971 
2
5
1 
3
5
1
2 3

2
3
log
2
2 3
 0 ,918  -0,018
 0,918
Árbol de decisión
(Construcción – nivel2)
Gain ([ 2 Play ,3 Don 'tPlay ], Temp )  0,57
Gain ([ 2 Play ,3 Don 'tPlay ], Humidity )  0 ,971
Gain ([ 2 Play ,3 Don 'tPlay ], Windy )  -0,018
Árbol de decisión
(Construcción – nivel3)
Outlook
Temp
Humidity
Windy
Class
sunny
hot
high
false
Don't Play
sunny
hot
high
true
Don't Play
sunny
mild
high
false
Don’t Play
Outlook
Temp
Humidity
Windy
Class
sunny
cool
normal
false
Play
sunny
mild
normal
true
Play
Árbol de decisión
(Construcción – nivel3)
Árbol de decisión
(Construcción – nivel2)
Outlook
Temp
Humidity
Windy
Class
overcast
hot
high
false
Play
overcast
cool
normal
true
Play
overcast
mild
high
true
Play
overcast
hot
normal
false
Play
Árbol de decisión
(Construcción – nivel2)
Árbol de decisión
(Solución)
Descargar

Construcción – nivel1