SlideShare a Scribd company logo
1 of 15
STUDI KASUS
PERHITUNGAN
TEOREMA BAYES
Dr. Hasanul Fahmi, M.KOM.
Pengantar
■ Teorema Bayes akhirnya dikembangkan dengan
berbagai ilmu termasuk untuk penyelesaian masalah
sistem pakar dengan menetukan nilai probabilitas dari
hipotesa pakar dan nilai evidence yang didapatkan fakta
yang didapat dari objek yang diagnosa.
■ Teorema ini menerangkan hubungan antara probabilitas
terjadinya peristiwa A dengan syarat peristiwa B telah
terjadi dan probabilitas terjadinya peristiwa B dengan
syarat peristiwa A telah terjadi. Teorema ini didasarkan
pada prinsip bahwa tambahan informasi dapat
memperbaiki probabilitas.
Contoh soal:
■ Andi terkena penyakit kulit dengan Gejala Gatal (G1), Kulit
Memerah(G2), Bengkak(g3), Bintik Bintik(G4), Kulit Terkelupas(G5).
■ Terdiri Dari 5 Gejala.
■ Carilah berapa persen andi terkena penyakit kulit dengan teorema
bayes.
Gejala Nilai
G1 0.8
G2 0.8
G3 0.3
G4 0.5
G5 0.1
Penyelesaian
Step 1
■ Jumlahkan semua gejala
Gejala Nilai
G1 0.8
G2 0.8
G3 0.3
G4 0.5
G5 0.1
Jumlah 2.5
Step 2
■ Setiap Gejala / Jumlah_Gejala
A1:
0.8
2.5
= 0.32
A2:
0.8
2.5
= 0.32
A3:
0.3
2.5
= 0.12
A4:
0.5
2.5
= 0.2
A5:
0.1
2.5
= 0.04
Step 3
■ Jumlahkan Seluruh Perkalian antara G dan A
■ =(G1*A1) + (G2*A2) + (G3*A3) + (G4*A4) + (G5*A5)= ?
■ =(0.8*0.32)+(0.8*0.32)+(0.3*0.12)+(0.5*0.2)+(0.1*0.04)=
0.652 (Misal C)
Step 4
■ Setiap Gejala / Jmlah_Gejala
D1:
G1 ∗ A1
C1
D2:
G2 ∗ A2
C1
D3:
G3 ∗ A3
C1
D4:
G4 ∗ A4
C1
D5:
G5 ∗ A5
C1
■ Jumlahkan Seluruh Perkalikan Antara Semua Gejala dengan masing
masing D
■ = (G1*D1) + (G2*D2) + (G3*D3) + (G4*D4) +(G5*D5)= …….. (misal E)
Setiap Gejala / Jumlah_Gejala
D1:
0.8 ∗ 0.32
0.652
= 0.392
D2:
0.8 ∗ 0.32
0.652
= 0.392
D3:
0.3 ∗ 0.12
0.652
= 0.055
D4:
0.5 ∗ 0.2
0.652
= 0.153
D5:
0.1 ∗ 0.04
0.652
= 0.006
■ Jumlahkan Seluruh Perkalikan Antara Semua Gejala dengan masing masing
D
■ = (G1*D1) + (G2*D2) + (G3*D3) + (G4*D4) +(G5*D5)=
■ = (0.8*0.392) + (0.8*0.392) + (0.3*0.055) + (0.5*0.153) +(0.1*0.006)= ……..
■ =0.313 + 0.313 + 0.0165 + 0.076 + 0.0006 = 0.7208 (misal E)
Step 5
Kalikan Hasil E dengan 100% untuk menentukan persentase
0.7208 * 100% = 72.08%
Kesimpulan :
Hasil diagnosa dengan metode Teorema Bayes
menyimpulkan 72.08% Andi Terkena Penyakit
Kulit
Contoh Program : *Sesuaikan Semua object yang ada
Double Klik Textbox G5
Dim g1 As Decimal = txtg1.Text
Dim g2 As Decimal = txtg2.Text
Dim g3 As Decimal = txtg3.Text
Dim g4 As Decimal = txtg4.Text
Dim g5 As Decimal = txtg5.Text
‘Step 1
txtjumlahG.Text = FormatNumber(g1 + g2 + g3 + g4 + g5, 2)
Dim j1 As Decimal = txtjumlahG.Text
‘Step 2
txta1.Text = FormatNumber(g1 / j1, 3)
txta2.Text = FormatNumber(g2 / j1, 3)
txta3.Text = FormatNumber(g3 / j1, 3)
txta4.Text = FormatNumber(g4 / j1, 3)
txta5.Text = FormatNumber(g5 / j1, 3)
Dim a1 As Decimal = txta1.Text
Dim a2 As Decimal = txta2.Text
Dim a3 As Decimal = txta3.Text
Dim a4 As Decimal = txta4.Text
Dim a5 As Decimal = txta5.Text
‘Step 3
txtjumlahC.Text = FormatNumber((g1 * a1) + (g2 * a2) + (g3 * a3) + (g4 * a4) + (g5 * a5), 3)
Dim c1 As Decimal = txtjumlahC.Text
' Step 4
txtd1.Text = FormatNumber((g1 * a1) / c1, 2)
Dim d1 As Decimal = txtd1.Text
txtd2.Text = FormatNumber((g2 * a2) / c1, 2)
Dim d2 As Decimal = txtd2.Text
txtd3.Text = FormatNumber((g3 * a3) / c1, 2)
Dim d3 As Decimal = txtd3.Text
txtd4.Text = FormatNumber((g4 * a4) / c1, 2)
Dim d4 As Decimal = txtd4.Text
txtd5.Text = FormatNumber((g5 * a5) / c1, 2)
Dim d5 As Decimal = txtd5.Text
txtjumlahD.Text = FormatNumber((g1 * d1) + (g2 * d2) + (g3 * d3) + (g4 * d4) + (g5 * d5), 2)
Dim r As Decimal = txtjumlahD.Text
Double klik pada button hasil
‘Step 5
Dim r As Double = txtjumlahD.Text
txthasil.Text = (r * 100) & "%"
If txthasil.Text > 50 & "%" Then
MsgBox("Hasil " & txthasil.Text & " Anda POSITIF Terkena Penyakit HATI")
Else
MsgBox("Hasil" & txthasil.Text & " Anda NEGATIF Terkena Penyakit HATI")
End If

More Related Content

More from fahmi324663

Week5-Faster R-CNN.pptx
Week5-Faster R-CNN.pptxWeek5-Faster R-CNN.pptx
Week5-Faster R-CNN.pptxfahmi324663
 
Week3- Face Identification with K-Nears Neighbour .pptx
Week3- Face Identification with K-Nears Neighbour .pptxWeek3- Face Identification with K-Nears Neighbour .pptx
Week3- Face Identification with K-Nears Neighbour .pptxfahmi324663
 
Week3-Deep Neural Network (DNN).pptx
Week3-Deep Neural Network (DNN).pptxWeek3-Deep Neural Network (DNN).pptx
Week3-Deep Neural Network (DNN).pptxfahmi324663
 
intelligentsystems-140424154432-phpapp01.pptx
intelligentsystems-140424154432-phpapp01.pptxintelligentsystems-140424154432-phpapp01.pptx
intelligentsystems-140424154432-phpapp01.pptxfahmi324663
 
Week2- Deep Learning Intuition.pptx
Week2- Deep Learning Intuition.pptxWeek2- Deep Learning Intuition.pptx
Week2- Deep Learning Intuition.pptxfahmi324663
 
Week1- Introduction.pptx
Week1- Introduction.pptxWeek1- Introduction.pptx
Week1- Introduction.pptxfahmi324663
 
WMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxWMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxfahmi324663
 
WMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptxWMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptxfahmi324663
 
si402_p02_konsep-arsitektur-enterprise.pptx
si402_p02_konsep-arsitektur-enterprise.pptxsi402_p02_konsep-arsitektur-enterprise.pptx
si402_p02_konsep-arsitektur-enterprise.pptxfahmi324663
 
Pertemuan 4 Metode Forward Chaining.pptx
Pertemuan 4  Metode Forward Chaining.pptxPertemuan 4  Metode Forward Chaining.pptx
Pertemuan 4 Metode Forward Chaining.pptxfahmi324663
 

More from fahmi324663 (11)

Week5-Faster R-CNN.pptx
Week5-Faster R-CNN.pptxWeek5-Faster R-CNN.pptx
Week5-Faster R-CNN.pptx
 
Week3- Face Identification with K-Nears Neighbour .pptx
Week3- Face Identification with K-Nears Neighbour .pptxWeek3- Face Identification with K-Nears Neighbour .pptx
Week3- Face Identification with K-Nears Neighbour .pptx
 
Week3-Deep Neural Network (DNN).pptx
Week3-Deep Neural Network (DNN).pptxWeek3-Deep Neural Network (DNN).pptx
Week3-Deep Neural Network (DNN).pptx
 
intelligentsystems-140424154432-phpapp01.pptx
intelligentsystems-140424154432-phpapp01.pptxintelligentsystems-140424154432-phpapp01.pptx
intelligentsystems-140424154432-phpapp01.pptx
 
Week2- Deep Learning Intuition.pptx
Week2- Deep Learning Intuition.pptxWeek2- Deep Learning Intuition.pptx
Week2- Deep Learning Intuition.pptx
 
Week1- Introduction.pptx
Week1- Introduction.pptxWeek1- Introduction.pptx
Week1- Introduction.pptx
 
WMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxWMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptx
 
WMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptxWMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptx
 
DSS-1.pptx
DSS-1.pptxDSS-1.pptx
DSS-1.pptx
 
si402_p02_konsep-arsitektur-enterprise.pptx
si402_p02_konsep-arsitektur-enterprise.pptxsi402_p02_konsep-arsitektur-enterprise.pptx
si402_p02_konsep-arsitektur-enterprise.pptx
 
Pertemuan 4 Metode Forward Chaining.pptx
Pertemuan 4  Metode Forward Chaining.pptxPertemuan 4  Metode Forward Chaining.pptx
Pertemuan 4 Metode Forward Chaining.pptx
 

Recently uploaded

Bahasa Arab kelas 4 BAB 6 (kosa kata tentang perlengkapan yang ada di rumah)
Bahasa Arab kelas 4 BAB 6 (kosa kata tentang perlengkapan yang ada di rumah)Bahasa Arab kelas 4 BAB 6 (kosa kata tentang perlengkapan yang ada di rumah)
Bahasa Arab kelas 4 BAB 6 (kosa kata tentang perlengkapan yang ada di rumah)ahmad0548
 
TUGAS MANDIRI 3 _ SKETSA KEHIDUPAN BERAGAMA DI INDONESIA.pdf
TUGAS MANDIRI 3 _ SKETSA KEHIDUPAN BERAGAMA DI INDONESIA.pdfTUGAS MANDIRI 3 _ SKETSA KEHIDUPAN BERAGAMA DI INDONESIA.pdf
TUGAS MANDIRI 3 _ SKETSA KEHIDUPAN BERAGAMA DI INDONESIA.pdfAbdulHalim854302
 
Biokimia Gizi 13: Metabolisme Mineral 2024.pptx
Biokimia Gizi 13: Metabolisme Mineral 2024.pptxBiokimia Gizi 13: Metabolisme Mineral 2024.pptx
Biokimia Gizi 13: Metabolisme Mineral 2024.pptxEmmyKardianasari
 
Materi Presentasi Dasar Perkembangan Tanaman.pptx
Materi Presentasi Dasar Perkembangan Tanaman.pptxMateri Presentasi Dasar Perkembangan Tanaman.pptx
Materi Presentasi Dasar Perkembangan Tanaman.pptxEkaOktaviani24
 
3_Kerangka Kompetensi Numerasi - M Ilhamul Qolbi
3_Kerangka Kompetensi Numerasi - M Ilhamul Qolbi3_Kerangka Kompetensi Numerasi - M Ilhamul Qolbi
3_Kerangka Kompetensi Numerasi - M Ilhamul Qolbimilhamulqolbi81
 
Biokimia Gizi 12: Metabolisme Vitamin 2024.pptx
Biokimia Gizi 12: Metabolisme Vitamin 2024.pptxBiokimia Gizi 12: Metabolisme Vitamin 2024.pptx
Biokimia Gizi 12: Metabolisme Vitamin 2024.pptxEmmyKardianasari
 
Uji triaxial pada material batuan beku sebagai penanda kekuatan pondasi
Uji triaxial pada material batuan beku sebagai penanda kekuatan pondasiUji triaxial pada material batuan beku sebagai penanda kekuatan pondasi
Uji triaxial pada material batuan beku sebagai penanda kekuatan pondasiHadisHasyimiMiftahul
 
PENGEMBANGAN & PERBANYAKAN TRICHODERMA SP.ppt
PENGEMBANGAN & PERBANYAKAN TRICHODERMA SP.pptPENGEMBANGAN & PERBANYAKAN TRICHODERMA SP.ppt
PENGEMBANGAN & PERBANYAKAN TRICHODERMA SP.pptaprilianto6
 

Recently uploaded (8)

Bahasa Arab kelas 4 BAB 6 (kosa kata tentang perlengkapan yang ada di rumah)
Bahasa Arab kelas 4 BAB 6 (kosa kata tentang perlengkapan yang ada di rumah)Bahasa Arab kelas 4 BAB 6 (kosa kata tentang perlengkapan yang ada di rumah)
Bahasa Arab kelas 4 BAB 6 (kosa kata tentang perlengkapan yang ada di rumah)
 
TUGAS MANDIRI 3 _ SKETSA KEHIDUPAN BERAGAMA DI INDONESIA.pdf
TUGAS MANDIRI 3 _ SKETSA KEHIDUPAN BERAGAMA DI INDONESIA.pdfTUGAS MANDIRI 3 _ SKETSA KEHIDUPAN BERAGAMA DI INDONESIA.pdf
TUGAS MANDIRI 3 _ SKETSA KEHIDUPAN BERAGAMA DI INDONESIA.pdf
 
Biokimia Gizi 13: Metabolisme Mineral 2024.pptx
Biokimia Gizi 13: Metabolisme Mineral 2024.pptxBiokimia Gizi 13: Metabolisme Mineral 2024.pptx
Biokimia Gizi 13: Metabolisme Mineral 2024.pptx
 
Materi Presentasi Dasar Perkembangan Tanaman.pptx
Materi Presentasi Dasar Perkembangan Tanaman.pptxMateri Presentasi Dasar Perkembangan Tanaman.pptx
Materi Presentasi Dasar Perkembangan Tanaman.pptx
 
3_Kerangka Kompetensi Numerasi - M Ilhamul Qolbi
3_Kerangka Kompetensi Numerasi - M Ilhamul Qolbi3_Kerangka Kompetensi Numerasi - M Ilhamul Qolbi
3_Kerangka Kompetensi Numerasi - M Ilhamul Qolbi
 
Biokimia Gizi 12: Metabolisme Vitamin 2024.pptx
Biokimia Gizi 12: Metabolisme Vitamin 2024.pptxBiokimia Gizi 12: Metabolisme Vitamin 2024.pptx
Biokimia Gizi 12: Metabolisme Vitamin 2024.pptx
 
Uji triaxial pada material batuan beku sebagai penanda kekuatan pondasi
Uji triaxial pada material batuan beku sebagai penanda kekuatan pondasiUji triaxial pada material batuan beku sebagai penanda kekuatan pondasi
Uji triaxial pada material batuan beku sebagai penanda kekuatan pondasi
 
PENGEMBANGAN & PERBANYAKAN TRICHODERMA SP.ppt
PENGEMBANGAN & PERBANYAKAN TRICHODERMA SP.pptPENGEMBANGAN & PERBANYAKAN TRICHODERMA SP.ppt
PENGEMBANGAN & PERBANYAKAN TRICHODERMA SP.ppt
 

Pertemuan 12 Teorema Bayes Lanjutan.pptx

  • 2. Pengantar ■ Teorema Bayes akhirnya dikembangkan dengan berbagai ilmu termasuk untuk penyelesaian masalah sistem pakar dengan menetukan nilai probabilitas dari hipotesa pakar dan nilai evidence yang didapatkan fakta yang didapat dari objek yang diagnosa. ■ Teorema ini menerangkan hubungan antara probabilitas terjadinya peristiwa A dengan syarat peristiwa B telah terjadi dan probabilitas terjadinya peristiwa B dengan syarat peristiwa A telah terjadi. Teorema ini didasarkan pada prinsip bahwa tambahan informasi dapat memperbaiki probabilitas.
  • 3. Contoh soal: ■ Andi terkena penyakit kulit dengan Gejala Gatal (G1), Kulit Memerah(G2), Bengkak(g3), Bintik Bintik(G4), Kulit Terkelupas(G5). ■ Terdiri Dari 5 Gejala. ■ Carilah berapa persen andi terkena penyakit kulit dengan teorema bayes. Gejala Nilai G1 0.8 G2 0.8 G3 0.3 G4 0.5 G5 0.1
  • 4. Penyelesaian Step 1 ■ Jumlahkan semua gejala Gejala Nilai G1 0.8 G2 0.8 G3 0.3 G4 0.5 G5 0.1 Jumlah 2.5
  • 5. Step 2 ■ Setiap Gejala / Jumlah_Gejala A1: 0.8 2.5 = 0.32 A2: 0.8 2.5 = 0.32 A3: 0.3 2.5 = 0.12 A4: 0.5 2.5 = 0.2 A5: 0.1 2.5 = 0.04
  • 6. Step 3 ■ Jumlahkan Seluruh Perkalian antara G dan A ■ =(G1*A1) + (G2*A2) + (G3*A3) + (G4*A4) + (G5*A5)= ? ■ =(0.8*0.32)+(0.8*0.32)+(0.3*0.12)+(0.5*0.2)+(0.1*0.04)= 0.652 (Misal C)
  • 7. Step 4 ■ Setiap Gejala / Jmlah_Gejala D1: G1 ∗ A1 C1 D2: G2 ∗ A2 C1 D3: G3 ∗ A3 C1 D4: G4 ∗ A4 C1 D5: G5 ∗ A5 C1 ■ Jumlahkan Seluruh Perkalikan Antara Semua Gejala dengan masing masing D ■ = (G1*D1) + (G2*D2) + (G3*D3) + (G4*D4) +(G5*D5)= …….. (misal E)
  • 8. Setiap Gejala / Jumlah_Gejala D1: 0.8 ∗ 0.32 0.652 = 0.392 D2: 0.8 ∗ 0.32 0.652 = 0.392 D3: 0.3 ∗ 0.12 0.652 = 0.055 D4: 0.5 ∗ 0.2 0.652 = 0.153 D5: 0.1 ∗ 0.04 0.652 = 0.006 ■ Jumlahkan Seluruh Perkalikan Antara Semua Gejala dengan masing masing D ■ = (G1*D1) + (G2*D2) + (G3*D3) + (G4*D4) +(G5*D5)= ■ = (0.8*0.392) + (0.8*0.392) + (0.3*0.055) + (0.5*0.153) +(0.1*0.006)= …….. ■ =0.313 + 0.313 + 0.0165 + 0.076 + 0.0006 = 0.7208 (misal E)
  • 9. Step 5 Kalikan Hasil E dengan 100% untuk menentukan persentase 0.7208 * 100% = 72.08% Kesimpulan : Hasil diagnosa dengan metode Teorema Bayes menyimpulkan 72.08% Andi Terkena Penyakit Kulit
  • 10. Contoh Program : *Sesuaikan Semua object yang ada
  • 11. Double Klik Textbox G5 Dim g1 As Decimal = txtg1.Text Dim g2 As Decimal = txtg2.Text Dim g3 As Decimal = txtg3.Text Dim g4 As Decimal = txtg4.Text Dim g5 As Decimal = txtg5.Text ‘Step 1 txtjumlahG.Text = FormatNumber(g1 + g2 + g3 + g4 + g5, 2) Dim j1 As Decimal = txtjumlahG.Text
  • 12. ‘Step 2 txta1.Text = FormatNumber(g1 / j1, 3) txta2.Text = FormatNumber(g2 / j1, 3) txta3.Text = FormatNumber(g3 / j1, 3) txta4.Text = FormatNumber(g4 / j1, 3) txta5.Text = FormatNumber(g5 / j1, 3) Dim a1 As Decimal = txta1.Text Dim a2 As Decimal = txta2.Text Dim a3 As Decimal = txta3.Text Dim a4 As Decimal = txta4.Text Dim a5 As Decimal = txta5.Text
  • 13. ‘Step 3 txtjumlahC.Text = FormatNumber((g1 * a1) + (g2 * a2) + (g3 * a3) + (g4 * a4) + (g5 * a5), 3) Dim c1 As Decimal = txtjumlahC.Text
  • 14. ' Step 4 txtd1.Text = FormatNumber((g1 * a1) / c1, 2) Dim d1 As Decimal = txtd1.Text txtd2.Text = FormatNumber((g2 * a2) / c1, 2) Dim d2 As Decimal = txtd2.Text txtd3.Text = FormatNumber((g3 * a3) / c1, 2) Dim d3 As Decimal = txtd3.Text txtd4.Text = FormatNumber((g4 * a4) / c1, 2) Dim d4 As Decimal = txtd4.Text txtd5.Text = FormatNumber((g5 * a5) / c1, 2) Dim d5 As Decimal = txtd5.Text txtjumlahD.Text = FormatNumber((g1 * d1) + (g2 * d2) + (g3 * d3) + (g4 * d4) + (g5 * d5), 2) Dim r As Decimal = txtjumlahD.Text
  • 15. Double klik pada button hasil ‘Step 5 Dim r As Double = txtjumlahD.Text txthasil.Text = (r * 100) & "%" If txthasil.Text > 50 & "%" Then MsgBox("Hasil " & txthasil.Text & " Anda POSITIF Terkena Penyakit HATI") Else MsgBox("Hasil" & txthasil.Text & " Anda NEGATIF Terkena Penyakit HATI") End If