Anda di halaman 1dari 2

Nama

Nim
Study kasus

: Sutrisna
: 1211705158
: Konser outdoor Metalica

umur
<=21
<=21
<=21
2130
>30
>30
3040
>40
>30
3040
>40

pendapatan
Low
Medium
Low
Medium
High
High
High
Medium
Medium
High
High

cuaca
Hujan
Cerah
Cerah
Hujan
Cerah
Cerah
Cerah
Cerah
Hujan
Hujan
cerah

musik_rock
Suka
Tidak
Tidak
Suka
Suka
Tidak
Tidak
Suka
Suka
Suka
Tidak

nonton_konser
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
No

Class :
C1 : nonton_konser=yes
C2 : nonton_konser=no
A. Data baru yang belum memiliki class
X = (umur > 30 , pendapatan = high , cuaca = cerah , music_rock = suka)

Menghitung
P( umur = >30 | nonton_konser = yes) = 1/6 = 0.166
P( umur = >30 | nonton_konser = no) = 2/5 = 0.4
P( pendapatan = high | nonton_konser = yes) = 2/6 = 0.333
P( pendapatan = high | nonton_konser = no) = 3/5 = 0.6
P( cuaca = cerah | nonton_konser = yes) = 4/6 = 0.666
P( cuaca = cerah | nonton_konser = no) = 3/5 = 0.6
P( music_rock = suka | nonton_konser = yes) = 4/6 = 0.666
P( music_rock = suka | nonton_konser = no) = 2/5 = 0.666

Nave Bayesian Classifier

Hitung
P( X | nonton_konser = yes) = 0.166 x 0.333 x 0.666 x 0.666
= 0.024

P( X | nonton_konser = no) = 0.4 x 0.6 x 0.6 x 0.4


= 0.057
-

Hitung
P( X | nonton_konser = yes) x P( nonton_konser = yes) = 0.015

P( X | nonton_konser = no) x P( nonton_konser = no) = 0.02

Jadi X memiliki class nonton_konser = yes karena P( X | nonton_konser = yes) memiliki


nilai maksimum pada perhitungan diatas.

Anda mungkin juga menyukai