Metode Bayesian
(Studi Kasus : Prediksi)
Jika terdapat sebuah tabel berisi data permainan tenis seperti berikut :
dan kondisi cuaca saat itu (Datum) adalah :
- Outlook : Sunny
- Temperature : Cool
- Humidity : High
- Wind : Strong
Pertanyaan : apakah seseorang tersebut akan bermain tenis? (Yes atau No)
Jawaban :
Rumus Bayesian : P(h | d) = [P(d | h) . P(h)] / P(d)
Kesimpulan :
Jawaban :
Rumus Bayesian : P(h | d) = [P(d | h) . P(h)] / P(d)
- Menghitung probabilitas "Sunny & Play" :
- P(Sunny | Play) = P(Sunny ∩ Play) / P(Play) = 2 / 9 = 0.22
- Menghitung probabilitas "Sunny & Not Play" :
- P(Sunny | -Play) = P(Sunny ∩ -Play) / P(-Play) = 3 / 5 = 0.6
- Menghitung probabilitas "Cool & Play" :
- P(Cool | Play) = P(Cool ∩ Play) / P(Play) = 3 / 9 = 0.33
- Menghitung probabilitas "Cool & Not Play" :
- P(Cool | -Play) = P(Cool ∩ -Play) / P(-Play) = 1 / 5 = 0.2
- Menghitung probabilitas "High & Play" :
- P(High | Play) = P(High ∩ Play) / P(Play) = 3 / 9 = 0.33
- Menghitung probabilitas "High & Not Play" :
- P(High | -Play) = P(High ∩ -Play) / P(-Play) = 4 / 5 = 0.8
- Menghitung probabilitas "Strong & Play" :
- P(Strong | Play) = P(Strong ∩ Play) / P(Play) = 3 / 9 = 0.33
- Menghitung probabilitas "Strong & Not Play" :
- P(Strong | -Play) = P(Strong ∩ -Play) / P(-Play) = 3 / 5 = 0.6
- Menghitung probabilitas "Play" :
- P(Play) = 9 / 14 = 0.64
- Menghitung probabilitas "Not Play" :
- P(-Play) = 5 / 14 = 0.35
- Menghitung probabilitas "Sunny, Cool, High, Strong & Play" :
- P(Sunny, Cool, High, Strong | Play) = 0.22 x 0.33 x 0.33 x 0.33 x 0.64 = 0.005
- Menghitung probabilitas "Sunny, Cool, High, Strong & Not Play" :
- P(Sunny, Cool, High, Strong | -Play) = 0.6 x 0.2 x 0.8 x 0.6 x 0.35 = 0.02
Kesimpulan :
Karena nilai probabilitas P(Sunny, Cool, High, Strong | -Play) > P(Sunny, Cool, High, Strong | Play), maka hasilnya adalah "No" atau orang tersebut tidak bermain tenis (Not Play)
0 comments:
Post a Comment