TOTO HARYANTO

Sedikit goresan menebar manfaat …..

Archive for March, 2012

Naive Bayes

Posted by totoharyanto on 27th March 2012

Sambil Mengingat Kembali Tentang Naive bayes.
Berikut contoh proses pengambilan keputusa dengan Naive Bayes.

  1. Diketahui Data Training Sebagai berikut:

ID

X1

X2

X3

Class

1

Yes

Single

125

No

2

No

Married

100

No

3

No

Single

70

No

4

Yes

Married

120

No

5

No

Divorce

95

Yes

6

No

Married

60

No

7

Yes

Divorce

220

No

8

No

Single

85

Yes

9

No

Married

75

No

10

No

Single

90

Yes

Dengan, menggunakan Naive Bayes, tentukan X(X1=No,X2=Married,X3=120)  ?

jawab:
P(Y=Yes) = 3/10,  P(Y=No) = 7/10

P(X1=No|Y=Yes) = 3/3 = 1
P(X1=No|Y=No) = 4/7

P(X2=Married|Y=Yes) = 0/3
P(X2=Married|Y=No)  = 4/7

P(X3=120|Y=Yes) = 0/3
P(X3=120|Y=No)  = 1/7

P (X1=No,X2=Married,X3=120|Y=Yes) :
= {P(P(X1=No|Y=Yes).P(X2=Married|Y=Yes).P(X3=120|Y=Yes).P(Y=Yes)}
=              {(1)                 .(0/3)                                 .(0/3)                            .(3/10)}
= 0

P (X1=No,X2=Married,X3=120|Y=No) :
= {P(P(X1=No|Y=No).P(X2=Married|Y=No).P(X3=120|Y=No).P(Y=No)}
=              {(4/7)                 .(4/7)                                 .(1/7)                            .(7/10)}
= 0,032

Sehingga Keputusannya adalah No

 

 

Silahkan Mencoba Jika : X(X1=Yes,X2=Divorce,X3=85)   ?

Kirim jawaban Anda melalui blog ini…

 

Selamat Mencoba….:-)

Posted in Sistem Pakar | 70 Comments »