Docsity

Information Gain Analysis for Decision Tree: Temperature, Humidity, Wind and Outlook, Assignments of Data Mining

Toggle sidebar
bg1
Outlook has the highest information gain so it is selected as first node/ root node.
1. Expected Information
info(D)=−Σ Pilog2
(
Pi
)
−Σ Pilog2
(
Pi
)
P(sunny|Y)=2/5 P (sunny|n)=3/5
=
−2
5log
2
(
2
5
)
−3
5log
2
(
3
5
)
=
−2
5×
log
(
2
5
)
log¿¿
=0.5287+0.4421 =0.970
2. Information(for each attribute)
info
A(
D¿=Σ¿Dj∨¿
¿D∨¿× I (Dj)¿¿
Temperatur
e
p n I(p,n)
hot 0 2 0
mild 1 1
cool 1 0 0
Outlook
Sunny Rainfall
Overcast
Outlook Temperatur
eHumidity Wind Decision
Sunny hot high weak no
Sunny hot high strong no
Sunny mild high weak no
Sunny cool normal weak yes
Sunny mild normal strong yes
pf3
pf4
pf5

Partial preview of the text

Download Information Gain Analysis for Decision Tree: Temperature, Humidity, Wind and Outlook and more Assignments Data Mining in PDF only on Docsity!

Outlook has the highest information gain so it is selected as first node/ root node.

1. Expected Information

info ( D )=− Σ Pi log 2 ( Pi ) − Σ Pi log 2 ( Pi ) P(sunny|Y)=2/5 P (sunny|n)=3/

log 2 (

log 2 (

×

log

log¿ ¿

2. Information(for each attribute)

info A( D^ ¿= Σ^ ¿^ Dj^ ∨^

¿ D ∨¿ × I ( Dj )¿

Temperatur

e

p n I(p,n)

hot 0 2 0

mild 1 1

cool 1 0 0

Outlook

Sunny (^) Rainfall Overcast

Outlook

Temperatur

e

Humidity Wind Decision

Sunny hot high weak no

Sunny hot high strong no

Sunny mild high weak no

Sunny cool normal weak yes

Sunny mild normal strong yes

infoA(D ¿^ =

× I (0,2)+

× I (1,1)+

× I (1,0)

× ¿

× 0 +

× 0.4+

× 0

infotemperature(D ¿^ =0.

Humidity p n I(p,n)

high 0 3 0

normal 2 0 0

infohumidity(D ¿^ =

× I (0,3)+

× I (2,0)

× ¿

infohumidity(D ¿ =

Wind p n I(p,n)

weak 1 2

strong 1 1

infowind(D ¿^ =

× I (1,2)+

× I (1,1)

× ¿

× 0.91829+

× 1

infowind(D ¿^ =0.

3. Gain Information

Gain Temperature = info (^ D )−¿^ infotemperature(D)

1) Expected Information

info ( D )=− Σ Pi log 2 ( Pi ) − Σ Pi log 2 ( Pi ) P(rainfall|Y)=3/5 P (rainfall|n)=2/

log 2 (

log 2 (

×

log (

log¿ ¿

2) Information(for each attribute)

info A( D^ ¿= Σ^ ¿^ Dj^ ∨^

¿ D ∨¿ × I ( Dj )¿

Temperatur

e

p n I(p,n)

hot 0 0 0

mild 2 1

cool 1 1 0

infotemperature(D ¿^ =

× I (2,1)+

× I (1,1)

× ¿

× 0.91829+

× 1

infotemperature(D ¿^ =0.

Wind p n I(p,n)

weak 3 0

strong 0 2

infowind(D ¿ =

× I (3,0)+

× I (0,2)

× 0 +

× 0

infowind(D ¿ =

3) GainInformation

Gain Temperature = info (^ D )−¿^ infotemperature(D)

Gain Wind = info (^ D )−¿^ infoWind(D)

=0.970-^0