1 / 17

Naïve Bayes

Naïve Bayes. Hamdani Mahasiswa ilkom ipb Dari berbagai sumber. Probabilities. Joint Probability that both X = x and Y=y Conditional Probability that X = x given that Y = y. Bayes Rule. Langkah Pembuatan Bayes. Tentukan Parameter Hitung prior probability suatu kondisi

Download Presentation

Naïve Bayes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Naïve Bayes Hamdani Mahasiswa ilkom ipb Dari berbagaisumber

  2. Probabilities • Joint • Probability that both X=x and Y=y • Conditional • Probability that X=x given that Y=y

  3. Bayes Rule

  4. LangkahPembuatan Bayes • Tentukan Parameter • Hitung prior probability suatukondisi • Membuat conditional probability table (CPT) • Membuat joint probability distribution (JPD) • Menghitung posterior probability • Inferensi probabilistic

  5. Contoh • MisalUntukmenentukanseseorangpergikuliahatautidakditentukanolehfaktorhujanatautidak diketahui: prior hujan P(hujan=yes)=0.1 dan P(hujan =no)=0.9

  6. Conditional probability table antaraHujandanKuliah

  7. Cara menghitungjoint probability distribution suatugejalaadalahmengalikannilaiconditional probability denganprior probability. • Prior probability hujanadalahuntuk yes=0.1 dan no=0.9 makadikalikandengan conditional

  8. Posterior Probability • Berdasarkan JPD diatas, dapatdihitungposterior probability darigejalahujan=yes adalah = 0.112

  9. ContohKasus

  10. HitungPeluangKebakaran= 5/10 • HitungPeluangTidakKebakaran=5/10 • Hitungnilai conditional prob. Contoh untukkelembapanjikakebakaran dibuatkategoriuntukkelembapan < 35 >=35

  11. Didapattabel MAKA <35 MERAH >=35 HITAM P(NILAI|Kategori) = (1 + Banyaknya data input yang jatuhpadakelasdengan interval tertentu )/(jumlah data + jumlah interval) P(Kelembapan<35|TIDAK)== 0.29 P(Kelembapan<35|Kebakaran)== 0.86

  12. P(Kelembapan>=35|Kebakaran)== 0.14 P(Kelembapan>=35|TIDAK)== 0.71 Untukkelembapan yang >=35 Sehinggadidapattabel conditional probantarakelembapandankebakaran

  13. Lakukanhal yang samauntukmasing-masingfaktor Didapatuntuk temperature

  14. ION • CO

  15. TESTING DATA BARU • Jikaterdapat data baru yang ingindiketahuistatusnya Temperature >=51 ION < 28 Kelembapan <35 CO <91

  16. Kita hitung P(Kebakaran|databaru) =P(Kebakaran)*(∏P(INPUT|Kebakaran)) =0.5*(P(T<51|Kebakaran)*P(K<35|Kebakaran)*P(I<28|Kebakaran)* P(C<91|Kebakaran)) =0.5*(0.14*0.86*0.86*0.86) =0.04 • Kita hitung P(TIDAK|databaru) =P(TIDAK)*(∏P(INPUT|TIDAK)) =0.5*(P(T<51|TIDAK)*P(K<35|TIDAK)*P(I<28|TIDAK)* P(C<91|TIDAK)) =0.5*(0.86*0.29*0.43*0.14) =0.0075

  17. Karena P(Kebakaran|databaru) lebihbesardari P(TIDAK|databaru) Makapersentasekebakaranuntukdatabaru= =84.19% MakapersentaseTIDAKuntukdatabaru= =15.81% Bisadiambil status KEBAKARAN=84.19%

More Related