Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Arboles de Decisión
Arboles de Decisión
CLASIFICACIÓN
INTRODUCCIÓN
• Método para aproximar funciones valor
discreto
• Equivalentes conjunto de reglas si..entonces
• Facilidad de interpretación
• Diversas aplicaciones: Diagnóstico médico,
riesgo en préstamos, series de tiempo, etc
REPRESENTACIÓN
• Árboles : Nodos y tallos
• Nodo: Atributo
• Tallos: Posibles valores para ese atributo
• Clasificación:
- Comienza nodo inicial
- Prueba atributo en el nodo
- Mueve a siguiente nodo
* Se repite el procedimiento anterior
VALORES
VARIABLES
APLICACIONES
• Problemas representados por atributos
• Respuesta tiene valores discretos
• Descripciones disyuntivas pueden ser
requeridas
• Datos de entrenamiento pueden estar
incompletos
DAY OUTLOOK TEMPERAT. HUMIDITY WIND PLAYTENNIS
OUTLOOK
NO YES NO YES
OUTLOOK
ATRIBUTOS
HUMIDITY
WIND
OUTLOOK
Ramas creadas para
OUTLOOK
Cada uno de los valores
Del atributo
Sunny Rainy
Overcast
Cuál atributo corresponde a
Cada uno de estos valores?
HUMIDITY HUMIDITY HUMIDITY
WIND WIND WIND
PRUEBA ESTADÍSTICA
log10 N ln N
log 2 N
log10 2 ln 2
• Probabilidades
p ÉXITO
Nro ÉXITOS
Nro CASOS
ENTROPÍA
• CASO 1. p1=0.2, p2=0.8
S=-0.2*log20.2-0.8log20.8=0.72
• CASO 2. p1=p2=0.5
S=-0.5*log20.5-0.5*log20.5=1
• CASO 2 : Máxima entropía, cualquiera
puede ocurrir, máxima cantidad información
para describir sistema
GANANCIA DE INFORMACIÓN
NO YES NO YES
POSIBILIDADES=[YES,NO]=[+,-]
Nro(+)=9, Nro(-)=5
9 9 5 5
Entropía gral Sistema=
* log 2 * log 2 0.94
14 14 14 14
ÁRBOL DE DECISIÓN
OUTLOOK
Sunny Rainy
Overcast
[2+,3-] [4+,0-] [3+,2-]
S(OUTLOOK)=p(sunny)*S(Sunny)+
p(Overcast)*S(Overcast)
p(Rainy)+S(Rainy)
ÁRBOL DE DECISIÓN
2 2 3 3
S ( Sunny) * log 2 * log 2 0.97
5 5 5 5
4 4 0 0
S (overcast) * log 2 * log 2 0
4 4 4 4
3 3 2 2
S ( Rainy) * log 2 * log 2 0.97
5 5 5 5
5 4 5
S(OUTLOOK)= * 0.97 * 0 * 0.97 0.69
14 14 14
GI(OUTLOOK,GRAL)=0.94-0.69=0.24
ÁRBOL DE DECISIÓN
TEMPERATURE
Cold Hot
Mild
[3+,1-] [4+,2-] [2+,2-]
S(TEMP.)=p(Cold)*S(Cold)+
p(Mild)*S(Mild)+
p(Hot)+S(Hot)
ÁRBOL DE DECISIÓN
3 3 1 1
S (Cool ) * log 2 * log 2 0.81
4 4 4 4
4 4 2 2
S ( Mild ) * log 2 * log 2 0.92
6 6 6 6
2 2 2 2
S ( Hot ) * log 2 * log 2 1.00
4 4 4 4
4 6 4
S(TEMPER.)= * 0. 81 * 0. 92 *1.00 0.91
14 14 14
GI(TEMPER.,GRAL)=0.94-0.91=0.03
ÁRBOL DE DECISIÓN
HUMIDITY
Normal High
[6+,1-] [3+,4-]
S(HUMID.)=p(Normal)*S(Normal)+p(High)*S(High)
ÁRBOL DE DECISIÓN
6 6 1 1
S ( Normal) * log 2 * log 2 0.59
7 7 7 7
3 3 4 4
S ( High) * log 2 * log 2 0.97
7 7 7 7
7 7
S(HUMIDI.)= * 0.59 * 0.97 0.78
14 14
GI(TEMPER.,GRAL)=0.94-0.78=0.16
ÁRBOL DE DECISIÓN
WIND
Weak Strong
[6+,2-] [3+,3-]
S(WIND)=p(Weak)*S(Weak)+p(Strong)*S(Strong)
ÁRBOL DE DECISIÓN
6 6 2 2
S (Weak ) * log 2 * log 2 0.81
8 8 8 8
3 3 3 3
S ( Strong ) * log 2 * log 2 1.00
6 6 6 6
8 6
S(WIND)= * 0.81 *1.00 0.88
14 14
GI(WIND.,GRAL)=0.94-0.88=0.06
ÁRBOL DE DECISIÓN
ATRIBUTO
GI(GRAL,OUTLOOK)=0.94-0.69=0.24
SELECCIONADO
GI(GRAL,TEMPER.)=0.94-0.91=0.03
GI(GRAL,HUMID.)=0.94-0.78=0.16
GI(GRAL.,WIND)=0.94-0.88=0.06
ÁRBOL DE DECISIÓN
OUTLOOK
Sunny Rainy
Overcast
?
YES
1 2 2
GI(Sunny,Temperature)= 0.97 * 0.0 *1.0 * 0.0 .570
5 5 5
2 3
GI(Sunny,Wind)= 0.97 *1.0 * 0.92 0.019
5 5
ÁRBOL DE DECISIÓN
Rainy
[3+,2-]
S(Rainy)=0.97
TEMPERATURE
WIND
3 2
GI(Sunny,Wind)= 0.97 * 0.0 * 0.0 0.97
5 5
0 3 2
GI(Rainy,Temperature)= 0.97 * 0.0 * 0.91 *1.0 0.28
5 5 5
ÁRBOL DE DECISIÓN
OUTLOOK
NO YES NO YES