1 / 73

Bayesian Networks

Bayesian Networks. Yeni Herdiyeni Departemen Ilmu Komputer. Overview. Decision-theoretic techniques Explicit management of uncertainty and tradeoffs Probability theory Maximization of expected utility Applications to AI problems Diagnosis Expert systems Planning Learning.

frayne
Download Presentation

Bayesian Networks

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. Bayesian Networks Yeni Herdiyeni Departemen Ilmu Komputer

  2. Overview • Decision-theoretic techniques • Explicit management of uncertainty and tradeoffs • Probability theory • Maximization of expected utility • Applications to AI problems • Diagnosis • Expert systems • Planning • Learning

  3. Course Contents • Concepts in Probability • Probability • Random variables • Basic properties (Bayes rule) • Bayesian Networks • Inference • Applications

  4. Probabilities • Probability distribution P(X|x) • X is a random variable • Discrete • Continuous • xis background state of information

  5. Discrete Random Variables • Finite set of possible outcomes X binary:

  6. Continuous Random Variable • Probability distribution (density function) over continuous values 5 7

  7. More Probabilities • Joint • Probability that both X=x and Y=y • Conditional • Probability that X=x given we know that Y=y

  8. Rules of Probability • Product Rule • Marginalization X binary:

  9. Bayes Rule

  10. Course Contents • Concepts in Probability • Bayesian Networks • Basics • Additional structure • Knowledge acquisition • Inference • Decision making • Learning networks from data • Reasoning over time • Applications

  11. Bayesian networks • Basics • Structured representation • Conditional independence • Naïve Bayes model • Independence facts

  12. Naïve Bayes vs Bayesian Network • Pada Naïve Bayes, mengabaikan korelasi antar variabel. • Sedangkan pada Bayesian Network, variabel input bisa saling dependent.

  13. P( S=no) 0.80 P( S=light) 0.15 P( S=heavy) 0.05 Smoking= no light heavy P( C=none) 0.96 0.88 0.60 P( C=benign) 0.03 0.08 0.25 P( C=malig) 0.01 0.04 0.15 Bayesian Networks Smoking Cancer

  14. Product Rule • P(C,S) = P(C|S) P(S)

  15. Marginalization P(Smoke) P(Cancer)

  16. Cancer= none benign malignant P( S=no) 0.821 0.522 0.421 P( S=light) 0.141 0.261 0.316 P( S=heavy) 0.037 0.217 0.263 Bayes Rule Revisited

  17. A Bayesian Network Age Gender Exposure to Toxics Smoking Cancer Serum Calcium Lung Tumor

  18. Independence Age and Gender are independent. Age Gender P(A,G) = P(G)P(A) P(A|G) = P(A) A ^G P(G|A) = P(G) G ^A P(A,G) = P(G|A) P(A) = P(G)P(A) P(A,G) = P(A|G) P(G) = P(A)P(G)

  19. Conditional Independence Cancer is independent of Age and Gender given Smoking. Age Gender Smoking P(C|A,G,S) = P(C|S) C ^ A,G | S Cancer

  20. Serum Calcium is independent of Lung Tumor, given Cancer P(L|SC,C) = P(L|C) More Conditional Independence:Naïve Bayes Serum Calcium and Lung Tumor are dependent Cancer Serum Calcium Lung Tumor

  21. P(E = heavy | C = malignant) > P(E = heavy | C = malignant, S=heavy) More Conditional Independence:Explaining Away Exposure to Toxics and Smoking are independent Exposure to Toxics Smoking E ^ S Cancer Exposure to Toxics is dependent on Smoking, given Cancer

  22. Age Gender Exposure to Toxics Smoking Cancer Serum Calcium Lung Tumor Put it all together

  23. General Product (Chain) Rule for Bayesian Networks Pai=parents(Xi)

  24. Conditional Independence A variable (node) is conditionally independent of its non-descendants given its parents. Age Gender Non-Descendants Exposure to Toxics Smoking Parents Cancer is independent of Age and Gender given Exposure to Toxics and Smoking. Cancer Serum Calcium Lung Tumor Descendants

  25. Another non-descendant Age Gender Cancer is independent of Dietgiven Exposure toToxics and Smoking. Exposure to Toxics Smoking Diet Cancer Serum Calcium Lung Tumor

  26. Bayesian Network • Bayesian Network atau Belief Network atau Probabilistik Network adalah model grafik untuk merepresentasikan interaksi antar variabel. • Bayesian Network digambarkan seperti graf yang terdiri dari simpul (node) dan busur (arc). Simpul menunjukkan variabel misal X beserta nilai probabilitasnya P(X) dan busur menunjukkan hubungan antar simpul. • Jika ada hubungan dari simpul X ke simpul Y, ini mengindikasikan bahwa variabel X ada pengaruh terhadap variabel Y. Pengaruh ini dinyatakan dengan peluang bersyarat P(Y|X).

  27. Bayesian Network - Latihan Yeni Herdiyeni

  28. Bayesian Network • Dari gambar tersebut dapat diketahui peluang gabungan dari P(R,W). Jika P(R) = 0.4, maka P(~R) = 0.6 dan jika P(~W|~R) = 0.8. • Kaidah Bayes dapat digunakan untuk membuat diagnosa.

  29. Bayesian Network Sebagai contoh jika diketahui bahwa rumput basah, maka peluang hujan dapat dihitung sebagai berikut :

  30. Bayesian Network • Berapa peluang rumput basah jika Springkler menyala (tidak diketahui hujan atau tidak)

  31. Bayesian Network • Berapa peluang Springkler menyala setelah diketahui rumput basah P(S|W)?

  32. Bayesian Network • Jika diketahui hujan, berapa peluang Springkler menyala?

  33. Bayesian Network • Bagaimana jika ada asumsi : Jika cuacanya mendung (cloudy), maka Springkler kemungkinan besar tidak menyala.

  34. Bayesian Network • Berapa peluang rumput basah jika diketahui cloudy?

  35. Bayesian Network • Berapa peluang rumput basah jika diketahui cloudy?

  36. Latihan • Jika ada seekor kucing yang suka berjalan di atap dan membuat keributan. Jika hujan, kucing tidak keluar. • Berapa peluang kita akan mendengar kucing diatap jika cuaca Cloudy? P(F|C)

  37. Course Contents • Concepts in Probability • Bayesian Networks • Inference • Decision making • Learning networks from data • Reasoning over time • Applications

  38. Inference • Patterns of reasoning • Basic inference • Exact inference • Exploiting structure • Approximate inference

  39. Predictive Inference Age Gender How likely are elderly males to get malignant cancer? Exposure to Toxics Smoking P(C=malignant| Age>60, Gender= male) Cancer Serum Calcium Lung Tumor

  40. Combined Age Gender How likely is an elderly male patient with high Serum Calciumto have malignant cancer? Exposure to Toxics Smoking Cancer P(C=malignant| Age>60, Gender= male, Serum Calcium = high) Serum Calcium Lung Tumor

  41. Smoking • If we then observe heavy smoking, the probability of exposure to toxics goes back down. Explaining away Age Gender • If we see a lung tumor, the probability of heavy smoking and of exposure to toxics both go up. Exposure to Toxics Smoking Cancer Serum Calcium Lung Tumor

  42. P(q, e) P(q | e) = P(e) Inference in Belief Networks • Find P(Q=q|E= e) • Q the query variable • E set of evidence variables X1,…, Xn are network variables except Q, E P(q, e) = S P(q, e, x1,…, xn) x1,…, xn

  43. Basic Inference A B P(b) = ?

  44. Product Rule S C • P(C,S) = P(C|S) P(S)

  45. Marginalization P(Smoke) P(Cancer)

  46. C P(b) = S P(a, b) = S P(b | a) P(a) a a P(c) = S P(c | b) P(b) b = S P(c | b) P(b | a) P(a) P(c) = S P(a, b, c) b,a b,a = S P(c | b) S P(b | a) P(a) b a P(b) Basic Inference A B

  47. = S P(x | y1, y2) P(y1) P(y2) because of independence of Y1, Y2: y1, y2 Inference in trees Y2 Y1 X X P(x) = S P(x | y1, y2) P(y1, y2) y1, y2

  48. Course Contents • Concepts in Probability • Bayesian Networks • Inference • Learning networks from data • Reasoning over time • Applications

  49. Course Contents • Concepts in Probability • Bayesian Networks • Inference • Applications

More Related