貝葉斯網絡
例如係好似附圖嗰個簡單(得三個變數)嘅貝葉斯網絡噉,個網絡睇咗三個變數-包括
而且會有一拃數值表示啲變數之間嘅條件概率-即係例如「如果落咗雨,啲草會濕咗嘅機率係幾多」,會用到好似以下噉嘅概率論數學符號:
個設計者寫好咗程式之後,可以(簡化噉講)搵一大柞紀錄咗呢幾個變數之間過往嘅關係嘅數據俾個程式睇,跟住叫個程式用呢啲數據計出變數同變數之間嘅關係係點(建立網絡),然後佢就可以攞個網絡嚟預測未來。廿一世紀初嘅研究表明,貝葉斯網絡式嘅 AI 有相當廣泛嘅用途,可以教電腦幫手睇症[5]或者預測電子遊戲對局嘅結果[6]呀噉。
定義
編輯貝葉斯網絡係種有向圖。有向圖呢種圖畫起上嚟會包括若干個框框(頂點),啲框之間有啲箭咀互相指住,而且啲箭咀表示緊一啲有方向性嘅關係( → → ),而貝葉斯網絡係有向圖嘅一種,有以下呢幾個特徵[7][8]:
- 每個頂點對應一個隨機變數,啲隨機變數係離散定連續都得;
- 每對項點之間都可以有箭咀,如果頂點 有個箭咀指住頂點 ( → ),噉 係 嘅母點(parent);
- 啲箭咀冇任何嘅有向循環(directed cycle)-即係話拃頂點之間彼此之間唔會形成一個圈噉;
- 是但攞個頂點 嚟睇, 都有個條件概率分佈 [註 1]-呢個條件概率分佈會講明「如果已知 啲母點嘅數值, 嘅數值嘅概率分佈」,用日常用語講即係話個條件概率分佈表示「母點嗰啲變數嘅數值會點影響 嘅數值嘅概率分佈」[9]。
舉個具體例子,想像上圖呢個簡單(得嗰三個變數)嘅貝葉斯網絡,
- 個網絡有三個變數-
- RAIN 係 SPRINKLER 同 GRASS WET 嘅母點,而 SPINKLER 就係 GRASS WET 嘅母點(由箭咀顯示)。
- 拃機率就如下[註 2]:
- (RAIN 係真嘅機率係 20%), -RAIN 係假嘅機率係 80%;
- SPRINKLER 左手邊嘅表反映 SPRINKLER 嘅概率分佈,當中
- 如果 , , -如果 RAIN 係真,SPRINKLER 嘅條件概率分佈;
- 如果 , , -如果 RAIN 係假,SPRINKLER 嘅條件概率分佈;
- GRASS WET 下面嘅表反映 GRASS WET 嘅概率分佈,當中
- 如果 嘅話, , -如果 RAIN 同 SPRINKER 都係真,GRASS WET 嘅條件概率分佈;
- ... 如此類推。
基本用途
編輯貝葉斯網絡可以用嚟做兩種推論。假設家陣手上有個能夠有返咁上下準確噉描述現象嘅貝葉斯網絡(姑且勿論個網絡係點整嘅),研究者可以[8][10]:
- 得知啲變數之間嘅聯合概率分佈[註 3]-意思即係話是但指定一個情況 (例如指定 ),研究者都可以攞個貝葉斯網絡計出呢個情況出現嘅機率
- 搵出啲變數之間嘅條件概率-假想家陣已知其中一部份變數嘅值 ,研究者可以攞個貝葉斯網絡計出
- 嘅機率,當中 係對數值未知嗰啲變數指定嘅值。
喺實際應用上,研究者可以攞大量嘅數據嚟建立貝葉斯網絡:簡單講,描述過去經驗嘅數據會話到俾部電腦知(例如)「根據以往嘅經驗,如果有一日
- 冇落雨( )而
- 啲灌溉花灑又冇著( ),
啲草有幾大機率( )會係濕咗」噉嘅資訊;而想像有位醫學嘅研究者由醫院等嘅地方收集數據,得知咗「如果有位病人感冒,佢有幾大機率會出發燒同鼻涕等嘅症狀」噉嘅資訊[註 4],就可以做到教電腦睇病嘅效果[5]。事實係喺廿一世紀初,貝葉斯網絡係人工智能最常見嘅做法之一,可以攞嚟教 AI 對感應到嘅現象作出預測[1][8]。
建立方法
編輯建立一個貝葉斯網絡會用到以下噉嘅步驟[11][12][13]:
- 決定項點:諗掂個網絡要包括啲咩變數 ;
- 決定箭咀:設 ,再一路重複以下嘅嘢:
- 操作化:研究者要諗掂啲變數實際上要點量度;
- 攞數據:搵啲數據返嚟,拃數據會有一個個個案,每個個案都係喺每個變數上有個數值;
- 例如如果研究者想整個貝葉斯網絡嚟幫手睇病,啲數據會包含若干位病人,每位病人係一個個案,都會喺拃變數上有個值-病人 A 有發燒有咳但冇感冒,病人 B 冇發燒有咳但有感冒... 如此類推;如果用關係數據庫嚟表示,望落會係噉嘅樣-
Case | 發燒? | 咳? | 感冒? |
---|---|---|---|
1 | Yes | Yes | No |
2 | No | Yes | Yes |
... | ... | ... | ... |
最後,研究者就會用啲數據估計個貝葉斯網絡啲參數,而呢步正路係搵電腦嚟計嘅(可以睇埋最大似然估計同梯度下降法等嘅最佳化相關課題)。假設個網絡嘅理論基礎有返咁上下正確而且啲數據有返咁上下代表性,最後理應會得出一個能夠相當準確噉描述現實嘅貝葉斯網絡。
註釋
編輯睇埋
編輯文獻
編輯- Borgelt C., Steinbrecher M., Kruse R. (2009). Graphical Models - Representations for Learning, Reasoning and Data Mining (Second ed.). Chichester: Wiley. ISBN 978-0-470-74956-2.
- Conrady S., Jouffe L. (2015-07-01). Bayesian Networks and BayesiaLab - A practical introduction for researchers. Franklin, Tennessee: Bayesian USA. ISBN 978-0-9965333-0-0.
- Charniak E. (Winter 1991). "Bayesian networks without tears" (PDF). AI Magazine.
- Kruse R., Borgelt C., Klawonn F., Moewes C., Steinbrecher M., Held P. (2013). Computational Intelligence A Methodological Introduction. London: Springer-Verlag. ISBN 978-1-4471-5012-1.
- Shute, V. (2015). Stealth assessment in video games (PDF).
- Shute V. J., Moore G. R. (2017). Consistency and validity in game-based stealth assessment (PDF). Technology enhanced innovative assessment: Development, modeling, and scoring from an interdisciplinary perspective, 296,有心理學家指,打機嗰陣嘅行為源自腦對遊戲世界俾反應,所以會反映個人嘅認知能力同性格特質;呢啲心理學家模擬心理特性同「打機嗰陣嘅行為」嘅啦掕-例如「有一關過唔到嗰時,個人肯花幾多時間繼續嘗試過關」理應會反映個人嘅恆心,班研究者跟住攞數據,然後教部電腦整貝葉斯網絡計 心理特性 遊戲行為 。
攷
編輯- ↑ 1.0 1.1 Bayesian inference algorithm:
- Russell & Norvig 2003, pp. 504-519,
- Poole, Mackworth & Goebel 1998, pp. 361-381,
- Luger & Stubblefield 2004, pp. ~363-379,
- Nilsson 1998, chpt. 19.4 & 7.
- ↑ Bayesian learning and the expectation-maximization algorithm:
- Russell & Norvig 2003, pp. 712-724,
- Poole, Mackworth & Goebel 1998, pp. 424-433,
- Nilsson 1998, chpt. 20.
- ↑ Bayesian decision theory and Bayesian decision networks:
- Russell & Norvig 2003, pp. 597-600.
- ↑ Charniak E. (Winter 1991). "Bayesian networks without tears" (PDF). AI Magazine.
- ↑ 5.0 5.1 Kahn Jr, C. E., Roberts, L. M., Shaffer, K. A., & Haddawy, P. (1997). Construction of a Bayesian network for mammographic diagnosis of breast cancer. Computers in biology and medicine, 27(1), 19-29.
- ↑ 6.0 6.1 Ilya, M., Mikhail, T., & Lada, T. (2015). Imitation of human behavior in 3d-shooter game. AIST'2015 Analysis of Images, Social Networks and Texts, 64.
- ↑ Borgelt C, Kruse R (March 2002). Graphical Models: Methods for Data Analysis and Mining. Chichester, UK: Wiley.
- ↑ 8.0 8.1 8.2 Introduction to Bayesian Networks. Towards Data Science.
- ↑ Ross, Sheldon M. (1993). Introduction to Probability Models (Fifth ed.). San Diego: Academic Press. pp. 88-91.
- ↑ Pearl, Judea (2000). Causality: Models, Reasoning, and Inference. Cambridge University Press.
- ↑ Kim, Y. J., Almond, R. G., & Shute, V. J. (2016). Applying evidence-centered design for the development of game-based assessments in physics playground (PDF). International Journal of Testing, 16(2), 142-163.
- ↑ Russell, S., & Norvig, P. (2002). Artificial intelligence: a modern approach. Ch 14.
- ↑ How to train a Bayesian Network (BN) using expert knowledge?. Towards Data Science.
- ↑ Seixas, F. L., Zadrozny, B., Laks, J., Conci, A., & Saade, D. C. M. (2014). A Bayesian network decision model for supporting the diagnosis of dementia, Alzheimer's disease and mild cognitive impairment. Computers in biology and medicine, 51, 140-158.
拎
編輯- BayANet: A Bayesian networks tool,一個俾人喺網上整貝葉斯網絡嘅網站。
- A Tutorial on Inference and Learning in Bayesian Networks (PDF).
- An Introduction to Bayesian Networks and their Contemporary Applications.
- On-line Tutorial on Bayesian nets and probability.
- Web-App to create Bayesian nets and run it with a Monte Carlo method.
- Continuous Time Bayesian Networks.
- Bayesian Networks: Explanation and Analogy.
- A live tutorial on learning Bayesian networks.
- A hierarchical Bayes Model for handling sample heterogeneity in classification problems, provides a classification model taking into consideration the uncertainty associated with measuring replicate samples.