Uploaded by User125884

Tugas DM Naive Bayes Siti Nur Jannah

advertisement
Nama : Siti Nur Jannah
NIM
: 1895124006
Prodi
: S1 Sistem Informasi
Data Training
no.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
age
spectacle-prescription astigmatic tear production rate contact-lenses
young
myope
no
reduced
none
young
myope
no
normal
soft
young
myope
yes
reduced
none
young
myope
yes
normal
hard
young
hypermetrope
no
reduced
none
young
hypermetrope
no
normal
soft
young
hypermetrope
yes
reduced
none
young
hypermetrope
yes
normal
hard
pre-presbyopic
myope
no
reduced
none
pre-presbyopic
myope
no
normal
soft
pre-presbyopic
myope
yes
reduced
none
pre-presbyopic
myope
yes
normal
hard
pre-presbyopic
hypermetrope
no
reduced
none
pre-presbyopic
hypermetrope
no
normal
soft
pre-presbyopic
hypermetrope
yes
reduced
none
pre-presbyopic
hypermetrope
yes
normal
none
presbyopic
myope
no
reduced
none
presbyopic
myope
no
normal
none
presbyopic
myope
yes
reduced
none
presbyopic
myope
yes
normal
hard
presbyopic
hypermetrope
no
reduced
none
presbyopic
hypermetrope
no
normal
soft
presbyopic
hypermetrope
yes
reduced
none
presbyopic
hypermetrope
yes
normal
none
Data Testing
no.
age
spectacle-prescription astigmatic tear production rate contact-lenses
1
pre-presbyopic
hypermetrope
yes
reduced
?
2
presbyopic
hypermetrope
no
normal
?
Mulai Kasus 1 (pre-presbyopic, hypermetrope, yes, reduced)
P(Ci)
P(none) = (15/24)
P(hard) = (4/24)
P(soft) = (5/24)
Kedua
P(X|Ci)
P(pre-presbyopic|none) = 5/15
P(pre-presbyopic|hard) = 1/4
P(pre-presbyopic|soft) = 2/5
P(hypermetrope|none) = 8/15
P(hypermetrope|hard) = 1/4
P(hypermetrope|soft) = 3/5
P(yes|none) = 8/15
P(yes|hard) = 4/4
P(yes|soft) = 0/5
P(reduced|none) = 12/15
P(reduced|hard) = 0/4
P(reduced|soft) = 0/5
Ketiga
P(X|Ci)
P(X|none)
= P(pre-presbyopic, hypermetrope, yes, reduced| none)
= 5/15 . 8/15 . 8/15 . 12/15 = 0.0759
P(X|hard)
= P(pre-presbyopic, hypermetrope, yes, reduced| hard)
= 1/4 . 1/4 . 4/4 . 0/4 = 0
P(X|soft)
= P(pre-presbyopic, hypermetrope, yes, reduced| soft)
= 2/5 . 3/5 . 0/5 . 0/5 = 0
Keempat
P(X|Ci)P(Ci)
P(X|none).P(none) = 0.0759 . 15/24 = 0.0474 = 4.74%
P(X|hard).P(hard) = 0 . 4/24 = 0 = 0%
P(X|soft).P(soft) = 0 . 5/24 = 0 = 0%
Kesimpulan
Untuk age pre-presbyopic, spectacle-prescription hypermetrope, astigmatic yes, tear
production rate reduced,
Masuk ke kelas NONE
Mulai Kasus 2 (Presbyopic, hypermetrope, no, normal)
P(Ci)
P(none) = (15/24)
P(hard) = (4/24)
P(soft) = (5/24)
Kedua
P(X|Ci)
P(presbyopic|none) = 6/15
P(presbyopic|hard) = 1/4
P(presbyopic|soft) = 1/5
P(hypermetrope|none) = 8/15
P(hypermetrope|hard) = 1/4
P(hypermetrope|soft) = 3/5
P(no|none) = 7/15
P(no|hard) = 0/4
P(no|soft) = 5/5
P(normal|none) = 3/15
P(normal|hard) = 4/4
P(normal|soft) = 5/5
Ketiga
P(X|Ci)
P(X|none)
= P(Presbyopic, hypermetrope, no, normal| none)
= 6/15 . 8/15 . 7/15 . 3/15 = 0.0199
P(X|hard)
= P(Presbyopic, hypermetrope, no, normal| hard)
= 1/4 . 1/4 . 0/4 . 4/4 = 0
P(X|soft)
= P(Presbyopic, hypermetrope, no, normal| soft)
= 1/5 . 3/5 . 5/5 . 5/5 = 0.12
Keempat
P(X|Ci)P(Ci)
P(X|none).P(none) = 0.0199 . 15/24 = 0.0124 = 1.24%
P(X|hard).P(hard) = 0 . 4/24 = 0 = 0%
P(X|soft).P(soft) = 0.12 . 5/24 = 0.025 = 2.5%
Kesimpulan
Untuk age presbyopic, spectacle-prescription hypermetrope, astigmatic no, tear
production rate normal,
Masuk ke kelas SOFT
Download