Data Mentah
Pembentukan Node
• Hitung Entropy
• Hitung Information Gain
Entropy Awal
• Jumlah instance = 8
• Jumlah instance positif = 3
• Jumlah instance negatif = 5
Hipertensi
P
ins ce positifP
ins ce positifP
ins ce negatifP
ins ce negatifEntropy
tan _log
2 tan _
tan _log
2 tan _
0,955
0,424
0,531
0.678
-
625
.
0
-1.415
375
.
0
625
.
0
log
625
.
0
375
.
0
log
375
.
0
8
5
log
8
5
8
Entropy Usia
• Jumlah instance = 8
• Instance Usia
– Muda
• Entropy Usia
– Entropy(muda) = 0.906
– Entropy(tua) = 1
ins ce positif ins ce positif ins ce negatif ins ce negatifnegatif ce
ins negatif
ce ins positif
ce ins positif
ce ins
P
P
P
P
Tua
Entropy
P
P
P
P
Muda
Entropy
_ tan 2
_ tan _
tan 2
_ tan
_ tan 2
_ tan _
tan 2
_ tan
log
log
log
log
Gain Usia
002
.
0
5
.
0
453
.
0
955
.
0
1
8
4
906
.
0
8
4
955
.
Tua Tua
Muda Muda
v Tua
Muda v
v
S
Entropy
S
S
S
Entropy
S
S
S
Entropy
S
Entropy
S
S
S
Entropy
Usia
Entropy Berat
• Jumlah instance = 8 • Intance Berat
– Overweight
• Instance positif = 3 • Instance negatif = 1
– Average
• Instance positif = 0 • Instance negatif = 2
– Underweight
• Instance positif = 0 • Instance negatif = 2
– Entropy(Overweight)=0.906 – Entropy(Average)=0.5
– Entropy(Underweight)=0.5
ins ce positif ins ce positif ins ce negatif ins ce negatif negatif ceins negatif
ce ins positif
ce ins positif
ce ins
negatif ce
ins negatif
ce ins positif
ce ins positif
ce ins
P P
P P
t Underweigh Entropy
P P
P P
Average Entropy
P P
P P
Overweight Entropy
_ tan 2
_ tan _
tan 2
_ tan
_ tan 2
_ tan _
tan 2
_ tan
_ tan 2
_ tan _
tan 2
_ tan
log log
log log
log log
Gain Usia
0,252
125 . 0 125 . 0 453 . 0 955 . 906 . 0 8 4 955 . Underweigh t
Underweigh average
Average Overweight
Overweight
v t
Underweigh Average
Overwight v
v
S Entropy S
S S
Entropy S
S S
Entropy S
S S Entropy
S Entropy S
S S
Entropy Berat
Entropy Jenis Kelamin
• Jumlah instance = 8
• Intance Jenis Kelamin
– Pria
• Instance positif = 2 • Instance negatif = 4
– Wanita
• Instance positif = 1 • Instance negatif = 1
– Entropy(Pria)=1
– Entropy(Wanita)=0.75
ins ce positif ins ce positif ins ce negatif ins ce negatifnegatif ce
ins negatif
ce ins positif
ce ins positif
ce ins
P P
P P
Wanita Entropy
P P
P P
ia Entropy
_ tan 2
_ tan _
tan 2
_ tan
_ tan 2
_ tan _
tan 2
_ tan
log log
log log
Gain Usia
0,017
188
.
0
75
.
0
955
.
955
.
0
min
,
Wanita Wanita
ia ia
v Wanita
ia v
v
S
Entropy
S
S
S
Entropy
S
S
S
Entropy
S
Entropy
S
S
S
Entropy
JenisKela
• Atribut yang dipilih adalah atribut berat karena nilai
Information Gainnya paling tinggi
• Jumlah Instance untuk Overweight = 4
• Jumlah Instance untuk Average = 2
• Jumlah Instance untuk Underweight = 2
• Hitung Gain paling tinggi untuk dijadikan cabang
berikutnya
Berat Overweight
Average
Node untuk cabang Overweight
• Jumlah instance = 4
• Instance (Berat = Overwight ) & Usia =
– Muda
• Instance positif = 1 • Instance negatif = 0
– Tua
• Instance positif = 2 • Instance negatif = 1
• Instance (Berat = Overwight ) & Jenis Kelamin =
– Pria
• Instance positif = 2 • Instance negatif = 1