Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi...
Transcript of Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi...
![Page 1: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/1.jpg)
Introdução a Inteligência Artificial
Prof. Paulo André Castro [email protected]/~pauloac Sala 110, IEC-ITA
![Page 2: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/2.jpg)
2 / 161
Paulo André Lima de Castro
• Bolsista de Produtividade Desen. Tec. e Extensão Inovadora do CNPq Nível 2.
• Engenheiro de Computação pelo Instituto Tecnológico de Aeronáutica (ITA, 1997), Mestre e Doutor pela Escola Politécnica da Universidade de São Paulo (Poli/USP 2009). Pós-doutorado na City University of New York (CUNY, 2013).
• Atualmente é professor do Instituto Tecnológico de Aeronáutica (ITA) e Chefe do Departamento de Metodologias de Computação da Divisão de Ciência da Computação do ITA.
• Participei de diversos projetos de Pesquisa e Desenvolvimento incluindo desenvolvimento de simuladores, avaliação de segurança da informação em sistemas computacionais e aplicação de técnicas inteligentes em sistemas distribuídos.
• Realizo pesquisas na área de Inteligência Artificial com ênfase em Sistemas multiagentes, atuando principalmente nos seguintes temas: agent-based finance, agentes autônomos e aplicações de técnicas inteligentes especialmente em economia e finanças
![Page 3: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/3.jpg)
3 / 161
Introdução a Inteligência Artificial Aula 1 - Introdução: conceitos e aplicações, agentes inteligentes e resolução de problemas por
busca
Aula 2 - Busca heurística: formalização e conceito de heurística, com exemplos
Aula 3 - Raciocínio probabilístico Probabilidades e crenças Modelos gráficos probabilísticos Inferência bayesiana
Aula 4 - Redes Bayesianas. Aprendizagem de Modelos probabilísticos
Decisão automatizada sobre incerteza Introdução a Engenharia de Conhecimento em Ambientes Incertos
Aula 5 - Aprendizado de Máquina: introdução, conceitos e aplicações
Aula 6 - Aprendizado supervisionado: conceitos básicos
Aula 7 - Aprendizado não supervisionado: conceitos básicos
![Page 4: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/4.jpg)
4 / 161
Bibliografia
Korb, K. Nicholson,A. Bayesian Artificial Intelligence. CRC Press. 2011.
Witten, I., Frank, E. Data Mining: Practical Machine learning Tools andTechniques. Elsevier. 2005.
RUSSEL, S.; NORVIG, P. Inteligência Artificial: Uma abordagem moderna. 3a.ed. Rio de Janeiro: Elsevier Editora, 2009.
Pearl, Judea. Probabilistic Reasoning in Intelligent Systems: Network ofPlausible Inference. Morgan Kaufmann, San Mateo, California. 1988
![Page 5: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/5.jpg)
5 / 161
Definições de IAPensando como seres humanos Pensando Racionalmente
“O novo e interessante esforço para fazer oscomputadores pensarem (…) máquinas com mentes, no sentido total e literal” (Haugeland, 1985)
“[Automação de] atividades que associamos aopensamento humano, atvidades como a tomadade decisões, a resolução de problemas, o aprendizado..” (Bellman, 1978)
“O estudo das faculdades mentais pelo uso de modelos computacionais” (Charniak e McDermoot, 1985)
“O estudo das computações que tornampossível perceber, raciocinar e agir” (Winston, 1992)
Agindo como Seres Humanos Agindo Racionalmente
“A arte de criar máquinas que executamfunções que exigem inteligência quandoexecutadas por pessoas” (Kurzweill, 1990)
“O estudo de como os computadores podemfazer tarefas que hoje são melhordesempenhadas por pessoas” (Rich and Knight, 1991)
“Inteligência Computacional é o estudo do projeto de agentes inteligentes” (Poole et al. 1998)
“IA…está relacionada a um desempenhointeligente de artefatos” (Nilsson, 1998)
![Page 6: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/6.jpg)
6 / 161
Inteligência Artificial – Novo ? O termo Inteligência Artificial foi usado oficialmente pela
primeira vez no verão de 1956, em um convite para um workshop de 2 meses organizado por John McCarthy, Marvin Minsky, Claude Shannon,e outros…
“We propose that a 2 month, 10 man study of artificial intelligence be carried out during the summer of 1956 at Dartmouth College in Hanover, New Hampshire. The study is to proceed on the basis of the conjecture that every aspect of learning or any other feature of intelligence can in principle be so precisely described that a machine can be made to simulate it. An attempt will be made to find how to make machines use language, form abstractions and concepts, solve kinds of problems now reserved for humans, and improve themselves.”
Perhaps “computational rationality” would have been more precise and lessthreatening, but “AI” has stuck....McCarthy stated that he resisted the terms“computer” or “computational” in deference to Norbert Weiner, who waspromoting analog cybernetic devices rather than digital computers
![Page 7: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/7.jpg)
7 / 161
What about …. ? Deep learning
“Deep learning is a subset of a more general field of artificial intelligence called machine learning” Buduma, N. The fundamentals of deep learning.
Machine Learning Construção de software “...que pode melhorar seu próprio
comportamento através do estudo diligente de suas próprias experiências” (Russel, Norvig, 2013)
Data mining Finding patterns in data that provide insight or enable fast
and accurate decision making (Witten,2005) Data Mining: Practical Machine learning)
Big data Capturing and managing lots of information (computer systems) Analyzing these masses of new data (data mining)
![Page 8: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/8.jpg)
8 / 161
Machine learning Definitions of “learning” from dictionary:
To get knowledge of by study,experience, or being taughtTo become aware by information orfrom observationTo commit to memoryTo be informed of, ascertain; to receive instruction
Difficult to measure
Trivial for computers
Things learn when they change their behavior in a way that makes them perform better in the future.
• Operational definition:
ML vs Statistics: “In truth, you should not look for a dividing line between machine learning and statistics because there is a continuum— and a multidimensional one at that—of data analysis techniques” Witten, Data Mining: Practical Machine learning.
![Page 9: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/9.jpg)
9 / 161
Data mining Finding patterns in data that provide insight or enable fast
and accurate decision making Strong, accurate patterns are needed to make decisions
Problem 1: most patterns are not interesting Problem 2: patterns may be inexact (or spurious) Problem 3: data may be garbled or missing
Machine learning techniques identify patterns in data and provide many tools for data mining
Machine learning techniques that provide structural descriptions are primary interest for data mining
In data mining, Machine learning is used as a way of ascertaining what factors are taken into account, not to automate the decision
![Page 10: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/10.jpg)
10 / 161
A “Reasonable” Graph Representation of Intersections of Related Areas to AI
![Page 11: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/11.jpg)
11 / 161
E Modelos Probabilísticos em Grafos? Desafios enfrentados por IA… Resolução de Problemas
Conhecimento: Raciocínio e planejamento
Incerteza: Conhecimento e Raciocínio
Aprendizado
Comunicação, percepção e Ação
![Page 12: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/12.jpg)
12 / 161
A IA como um Campo Multidisciplinar
![Page 13: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/13.jpg)
13 / 161
Agentes Um agente é tudo que pode ser considerado capaz de perceber seu
ambiente por meio de sensores e de agir sobre esse ambiente por intermédio de atuadores.
Exemplos: agente animal, agente robótico, agente de software, termostatos….
Figura 01 – Diagrama esquemático de um agente reativo simples.
![Page 14: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/14.jpg)
14 / 161
Agentes Reativos Simples
![Page 15: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/15.jpg)
15 / 161
Agentes Reativos Baseados em Modelo
![Page 16: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/16.jpg)
16 / 161
Agentes Baseados em Objetivos
![Page 17: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/17.jpg)
17 / 161
Agentes Baseados na Utilidade
![Page 18: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/18.jpg)
18 / 161
Agentes Baseados em Aprendizado
![Page 19: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/19.jpg)
19 / 161
Ambiente: Onde os agentes vivem e atuam Propriedades dos Ambientes Observável x Parcialmente Observável Determinístico x Estocástico Episódico x Seqüencial Estático x Dinâmico Discreto x Contínuo Agente Único x Multiagente
![Page 20: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/20.jpg)
20 / 161
Uncertainty (Partially observed or stochastic) environments?
![Page 21: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/21.jpg)
21 / 161
Example 1: Breast Cancer
![Page 22: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/22.jpg)
22 / 161
Example 2: People vs Collins
![Page 23: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/23.jpg)
23 / 161
Example 2: People vs Collins – cont.
Is the probability estimate correct? No. The product rule does not apply in this case!! What is the probability of the couple being guilty?
![Page 24: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/24.jpg)
24 / 161
Example 2: People vs Collins – cont. The pieces of evidence are NOT independent!!!
Furthermore, P(h|e) is not equal to 1-P(e| not h), but:
And by Sum-out..
P(e|h) ?
![Page 25: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/25.jpg)
25 / 161
Example 2: People vs Collins – cont.
Let’s say there are 1,625,000 eligible males and as many female in Los Angeles area...so:
![Page 26: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/26.jpg)
26 / 161
Revisão de Conceitos Básicos de ProbabilidadeP(A | K) – probabilidade condicional ou posterior.Crença em A, dado o corpo de informação K.
P(A) – probabilidade a priori: Crença em A, na falta de informação adicional proveniente de K.
Uma Variável aleatória tem um domínio (conjunto de valores)e associada a cada um a probabilidade de ocorrência daquele valor. Essa função é chamada de distribuição de Probabilidade.Exemplo: Variável Tempo = {Sol, Chuva, Nublado}P(Tempo) – é uma distribuição de probabilidadeP(Tempo) = <0,7;0,2;0,1>
P(Tempo=sol) = 0.7P(Tempo=chuva) = 0.2P(Tempo=nublado) = 0.1
No caso contínuo, usa-se o termo função de densidade de probabilidade. Vamos focar no caso discreto.
![Page 27: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/27.jpg)
27 / 161
Axiomas da Probabilidade Para qualqueis proposições A e B
![Page 28: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/28.jpg)
28 / 161
Syntax
![Page 29: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/29.jpg)
29 / 161
Syntax - 2
![Page 30: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/30.jpg)
30 / 161
Probabilidade condicionalProbabilidade condicional ou posterior, e.g., P(cárie|dordedente) = 0.8
i.e., dado que dordedente é tudo que conheço, a chance de cárie (vista por mim) é de 80%.
P(Cárie | Dordedente) = Vetor de 2 elementos cada um com dois elementos. Por Exemplo: P(Cárie | Dordedente) = <<0,8;0,2>;<0,01;0,99>>
Se sabemos mais, e.g., cárie é também observada, então
P(cárie|dordedente, cárie) = 1OBS:
1) A crença menos específica permanece válida, mas pode ficar inútil.
2) A nova evidência pode ser inútil:
P(cárie|dordedente, Corinthians derrotado) = P(cárie|dordedente) = 0.8
NOTE A IMPORTÂNCIA DO CONHECIMENTO DO DOMÍNIO PARA QUALQUER PROCESSO DE INFERÊNCIA.
![Page 31: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/31.jpg)
31 / 161
O Axioma Básico da Prob. condicional
Ou:
![Page 32: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/32.jpg)
32 / 161
Regra da Cadeia
Prova:
![Page 33: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/33.jpg)
33 / 161
Inversão Bayesiana (Regra de Bayes)
P(H|e): Probabilidade posterior
P(H): Probabilidade a priori
Por quê a fórmula é importante?
Muitas vezes P(e|H) é fácil de calcular, ao contrário de P(H|e)?
![Page 34: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/34.jpg)
34 / 161
Another example: Meningitis Let’s assume 0.8 of people with Meningitis have stiff neck,
probability of Meningitis is 1 in 10000 and 0.1 of having stiff neck..
![Page 35: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/35.jpg)
35 / 161
Normalization
Let’s say we want to calculate P(H|e), the posterior probability distribution over H given a piece of evidence e, and H has n possible values (h1 , …hn)
We can apply Baye’s rule for each value of H
Suming up and Noting that , . We have:
![Page 36: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/36.jpg)
36 / 161
Normalization - 2 As,
P(e) is just a normalization factor in :
And we can calculate P(H|e), without explicitly estimating P(e), using a normalization factor α
![Page 37: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/37.jpg)
37 / 161
Full joint distributions
![Page 38: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/38.jpg)
38 / 161
Full joint distributions - 2
![Page 39: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/39.jpg)
39 / 161
Inference from Full joint distributions
d - number of possible elements of variable, n – number of variables
![Page 40: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/40.jpg)
40 / 161
lnteligência Artificial
Introdução a Redes Bayesianas
Prof. Paulo André Castro [email protected]/~pauloac Sala 110, IEC-ITA
![Page 41: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/41.jpg)
41 / 161
Sumário Interpretação de Probabilidades
Redes Bayesianas ou Redes de crença
Inferência probabilística
Aprendizado em método probabilísticos
Métodos simplificados: Bayes ingênuo e Noisy-OR
![Page 42: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/42.jpg)
42 / 161
Interpretations of Probabilities
Do we need to toss a coin infinity (or many times) to make statements about the probability of it landing head in one specific toss?
The alternative view of probability is to think of probabilities as reporting our subjective degrees of belief. This view was expressed by Thomas Bayes (1958) and Pierre Simon de Laplace (1951)
![Page 43: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/43.jpg)
43 / 161
Principal Principle and Conditionalization
![Page 44: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/44.jpg)
44 / 161
Rede Bayesiana ou Rede de Crença (Belief Network)
![Page 45: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/45.jpg)
45 / 161
Example: Is it an Earthquake or burglar?
![Page 46: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/46.jpg)
46 / 161
Example - 2
![Page 47: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/47.jpg)
47 / 161
Markov Blanket (Cobertor de Markov)
![Page 48: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/48.jpg)
48 / 161
Método para construção de uma rede
![Page 49: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/49.jpg)
49 / 161
Exemplo
![Page 50: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/50.jpg)
50 / 161
![Page 51: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/51.jpg)
51 / 161
![Page 52: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/52.jpg)
52 / 161
![Page 53: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/53.jpg)
53 / 161
![Page 54: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/54.jpg)
54 / 161
![Page 55: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/55.jpg)
55 / 161
Outro Exemplo: Conserto de Carro
![Page 56: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/56.jpg)
56 / 161
Exemplo: Seguro de Carro Problema: Estimar custos (Medical, Liability, Property)
dados as informações do segurado e outras disponíveis por outras fontes (em Cinza)
![Page 57: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/57.jpg)
57 / 161
I-map and D-map and Perfect Map I-map: If there are no direct dependencies in the system
being modeled which are not already explicitly shown via arcs, the BN is called an Independence Map (or, I-map for short).
D-map: If every arc in a BN happens to correspond to a direct dependence in the system, then the BN is said to be a Dependence-map (or, D-map for short).
A BN which is both an I-map and a D-map is said to be a perfect map.
![Page 58: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/58.jpg)
58 / 161
Sumário Redes Bayesianas ou Redes de crença
Inferência probabilística
Aprendizado em método probabilísticos
Métodos simplificados: Bayes ingênuo e Noisy-OR
![Page 59: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/59.jpg)
59 / 161
Inferência em Redes Bayesianas Dada uma rede, devemos ser capaz de inferir a partir dela
isto é :
Busca responder questões simples, P(X| E=e) Ex.:
Ou questões conjuntivas: P( Xi , Xj | E=e) Usando o fato:
A inferência pode ser feita a partir da distribuição conjunta total ou por enumeração
![Page 60: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/60.jpg)
60 / 161
Inferência com Distribuição Conjunta Total: Exemplo Por exemplo para saber P(A|b) temos P(A|b)= P(A,b)/P(b)=
<P(a, b)/P(b);P(⌐a , b)/P(b) > =
= α < P(a, b);P(⌐a , b)> = α [ <P(a,b,c)+P(a,b,⌐c); P(⌐a,b,c)+P(⌐a,b, ⌐c)>]
Observe que α pode ser visto como um fator de normalização para o vetor resultante da distribuição de probabilidade, pedida P(A|b). Assim pode-se evitar seu cálculo, Simplesmente normalizando <P(a,b); P(⌐a , b) >
![Page 61: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/61.jpg)
62 / 161
Inferência por Enumeração
![Page 62: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/62.jpg)
63 / 161
Inferência por Enumeração - 2
Pode ser melhorada através do armazenamento dos valores já calculados (Programação Dinâmica)
![Page 63: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/63.jpg)
64 / 161
Calculando P(b) não normalizado"P(b) nao normalizado"
0,0005922
0,001
+ 0,5922426
0,001197 0,591046
* 0,002 * 0,998
+ 0,598525 + 0,59223
0,5985 0,000025 0,5922 0,00003 Produtorio
0,95 0,05 0,94 0,06
0,9 0,01 0,9 0,01
0,7 0,05 0,7 0,05
![Page 64: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/64.jpg)
65 / 161
Calculando P(não b) não normalizado"P(nao b) nao normalizado"
0,001492
0,999
+ 0,001493
0,000366 0,001127
* 0,002 * 0,998
+ 0,183055 + 0,00113
0,1827 0,000355 0,00063 0,0005
0,29 0,71 0,001 0,999
0,9 0,01 0,9 0,01
0,7 0,05 0,7 0,05
![Page 65: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/65.jpg)
66 / 161
Algoritmo de Enumeração
![Page 66: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/66.jpg)
67 / 161
Inferência por Enumeração Algoritmo de Enumeração permite determinar uma
distribuição de probabilidade condicional P(variável de saída| evidências conhecidas)
Também é possível responder perguntas conjuntivas usando o fato:
Demonstração?….
![Page 67: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/67.jpg)
68 / 161
Demonstração
como:
![Page 68: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/68.jpg)
69 / 161
Inferência por Enumeração Como observado, a enumeração tende a recalcular várias
vezes alguns valores
Pode-se eliminar parte do retrabalho através da técnica de programação dinâmica (eliminação de variável)… Basicamente, os valores já calculados são armazenados em uma tabela e selecionados quando novamente necessários…(mais informações Russel, cap. 14)
![Page 69: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/69.jpg)
72 / 161
Sumário Redes Bayesianas ou Redes de crença
Inferência probabilística
Aprendizado em método probabilísticos
Métodos simplificados: Bayes ingênuo e Noisy-OR
![Page 70: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/70.jpg)
73 / 161
Aprendizado em modelos probabilísticos Aprender em redes bayesianas é o processo de
determinar a topologia da rede (isto é, seu grafo direcionado) e as tabelas de probabilidade condicional
Problemas? Como determinar a topologia? Como estimar as probabilidades ? Quão complexas são essas tarefas?
Isto é quantas topologias e quantas probabilidades precisariam ser determinadas….
![Page 71: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/71.jpg)
74 / 161
Tamanho das Tabelas de Probabilidade Condicional e Distribuição Conjunta Total Vamos supor que cada variável é influenciada por no máximo k outras variáveis
(Naturalmente, k<n=total de variáveis).
Supondo variáveis booleanas, cada tabela de probabilidade condicional (CPT) terá no máximo 2k entradas (ou probabilidades). Logo ao total haverá no máximo n* 2k entradas
Enquanto, na distribuição conjunta Total haverá 2n entradas. Por exemplo, para n=30 com no máximo cinco pais (k=5) isto significa 960 ao invés de mais um bilhão (230)
![Page 72: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/72.jpg)
75 / 161
Número de “entradas” da Distribuição Conjunta e na Rede Bayesiana - 2 Em domínios onde cada variável pode ser diretemante influenciada por todas
as outras, tem-se a rede totalmente conectada e assim exige-se a quantidade de entradas da mesma ordem da distribuição conjunta total
Porém se essa dependência for tênue, pode não valer a pena a complexidade adicional na rede em relação ao pequeno ganho em exatidão
Via de regra, se nos fixarmos em um modelo causal acabaremos tendo de especificar uma quantidade menor de números, e os números frequentemente serão mais fáceis de calcular. (Russel,Norvig, 2013, pg. 453)
Modelos causais são aqueles onde se especifica no sentido causa efeito, isto é P(efeito|causa) ao invés de P(causa|efeito), oque geralmente é necessário para diagnóstico
![Page 73: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/73.jpg)
76 / 161
Simplificando a representação tabelas de probabilidade condicional (CPT) Vimos que que o número de entradas de uma CPT
cresce exponencialmente Para o caso binário e K pais, a CPT de um nó terá 2k
probabilidades a serem calculadas
Vejamos duas abordagens para simplificar a rede através da adoção de hipóteses simplificadoras Bayes Ingênuo e OU-ruidoso
![Page 74: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/74.jpg)
77 / 161
Naïve Bayes (Bayes Ingênuo) Uma classe particular e simples de redes bayesianas é
chamada de Bayes Ingênuo (Naïve Bayes) Ela é simples por supor independência condicional entre
todas as variáveis X dada a variável Class As vezes, chamado também de classificador Bayes, por ser
frequentemente usado como abordagem inicial para classificação
![Page 75: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/75.jpg)
78 / 161
Naïve Bayes (Bayes Ingênuo) - 2 A topologia simples traz a vantagem da representação
concisa da Distribuição Conjunta Total. Como todo os nós tem no máximo um pai, cada CPT de
no X tem apenas duas entradas e uma entrada no nó classe. Logo, (2n-1) entradas para toda a rede. Naïve Bayes é linear em relação ao número de nós (n) !!!!
“Na prática, sistemas de Bayes ingênuos podem funcionar surpreendentemente bem….”. pg. 438
![Page 76: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/76.jpg)
79 / 161
Exemplo de Naïve Bayes Vamos retomar o exemplo do jogo de tênis
NÃOForteAltaBoaChuvosoX14SIMFracoNormalQuenteNubladoX13SIMForteAltaBoaNubladoX12SIMForteNormalBoaEnsolaradoX11SIMFracoNormalBoaChuvosoX10SIMFracoNormalFriaEnsolaradoX9NÃOFracoAltaBoaEnsolaradoX8SIMForteNormalFriaNubladoX7NÃOForteNormalFriaChuvosoX6SIMFracoNormalFriaChuvosoX5SIMFracoAltaBoaChuvosoX4SIMFracoAltaQuenteNubladoX3NÃOForteAltaQuenteEnsolaradoX2NÃOFracoAltaQuenteEnsolaradoX1JogarTênisVentoUmidadeTemperaturaCéuEx
![Page 77: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/77.jpg)
80 / 161
Usando a abordagem Bayes ingênuo
Problema a resolver:
![Page 78: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/78.jpg)
81 / 161
Solução: P(Play|Outlook,Temp,Hum,Wind)= P(Outlook,Temp,Hum,Wind|Play)P(Play)/P(Outlook,Temp,
Hum,Wind)= Regra da cadeia e indepêndencia: P(Outlook|Play)P(Temp|Play)P(Hum|Play)P(Wind|Play)P(Pl
ay)/ P(Outlook,Temp,Hum,Wind)
O método de inferência por enumeração já visto é aplicável!!!
Estima-se as probabilidades pelo conjunto de treinamento
![Page 79: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/79.jpg)
82 / 161
Contagens e probabilides estimadas pelo conjunto de treinamento
P(Play=s|Outlook=sunny,Temp=cool,Hum=high,Wind=true)=
P(sunny|play)P(cool|play)P(high|play)P(true|play)P(Play) /P(evidencia) = 2/9*3/9*3/9*3/9*9/14 / P(e) =0.0053/P( e)
![Page 80: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/80.jpg)
83 / 161
Solução 3 - continuação Da mesma forma, P(sunny|play)P(cool|play)P(high|play)P(true|play)P(Play)/P(
e) = 3/5*1/5*4/5*3/5*5/14/P(e) =0.0206/P( e) Mas P(H,e) e P(not H,e) tem que somar 1, assim:
![Page 81: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/81.jpg)
84 / 161
Estimativas de Probabilides Qual a estimativa da probabilidade
P(Outlook=overcast|Play=no)?
Zero! Isto é razoável? Como resolver? Uma Solução: estimador de Laplace (Laplace smoothing). Seja V o número
de valores possíveis para A, estima-se P(A|B) :
P(A=a|B=b) = [N(A=a,B=b)+1]/[N(B=b)+V]
![Page 82: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/82.jpg)
[Rational ]Decisions with Bayesian Networks
Prof. Paulo André Castro [email protected]/~pauloac Sala 110, IEC-ITA
![Page 83: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/83.jpg)
86 / 161
[Rational] Decisions
Rational Preferences and Lotteries
Money x Utility
Decision Networks
![Page 84: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/84.jpg)
87 / 161
Lotteries
![Page 85: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/85.jpg)
88 / 161
Preferências Racionais
![Page 86: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/86.jpg)
89 / 161
Violação das Restrições leva a “Irracionalidade”
![Page 87: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/87.jpg)
90 / 161
Maximizing Expected Utility (MEU)
![Page 88: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/88.jpg)
91 / 161
Estimando Utilidades
![Page 89: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/89.jpg)
92 / 161
Definindo Funções de Utilidades através de loterias Dado o intervalo [0,1] entre a “pior catastrofe possível” e
“o melhor prêmio possível”, ao encontrar uma loteria [p,1;1-p,0] que seja indiferente a uma situação S o número p é a utilidade de S
Em ambientes, com prêmios determinísticos pode-se apenas estabelecer a ordem de preferências, nesse caso usa-se o termo utilidades ordinais
Funções de utilidades ordinais podem ser chamadas de funções de valor e são invariantes para qualquer transformação monotônica
![Page 90: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/90.jpg)
93 / 161
Utilidade do dinheiro Preferências de um grupo sobre dinheiro certo (x) e
loteria [p,M;1-p,0]
![Page 91: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/91.jpg)
94 / 161
Dinheiro vs Utilidade Dinheiro não tem uma relação linear (ou simples) com utilidade!
Ao estimar a utilidade em vários experimentos, observa-se que dada uma loteria L com valor esperado EMV(L) tem-se U(L) < U (EMV(L)), isto é as pessoas são aversas a risco
Um gráfico típico de dinheiro ($) vs Utilidade (U):
![Page 92: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/92.jpg)
95 / 161
The Saint Petersburg Paradox The paradox is named from Daniel Bernoulli's presentation of the problem
and his solution, published in 1738 in St. Petersburg
A casino offers a game of chance for a single player in which a fair coin is tossed at each stage. The pot starts at 1 dollar and is doubled every time a head appears. The first time a tail appears, the game ends and the player wins whatever is in the pot.
Thus the player wins 1 dollar if a tail appears on the first toss, 2 dollars if a head appears on the first toss and a tail on the second.
Two questions: How much would you accept to pay for playing this game?
What is the expected monetary value of the game?
![Page 93: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/93.jpg)
96 / 161
The Saint Petersburg Paradox As Bernoulli stated:
The determination of the value of an item must not be based on the price, but rather on the utility it yields…. There is no doubt that a gain of one thousand ducats is more significant to the pauper than to a rich man though both gain the same amount
Bernoulli proposed that utility of money should be logarithmic. U(M)= a*log2(M)+b
This makes EMV to be a finite value.
But it’s always possible to recreate the paradox by changing the function!!! Alternative theories may provide a better description model
(Prospect Theory)
![Page 94: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/94.jpg)
97 / 161
Problemas na Teoria da maximização da utilidade esperada A teoria da maximização da utilidade esperada é uma
teoria normativa. Ela descreve como um agente deve reagir. Entretanto, não é uma teoria descritiva da tomada de decisões reais
Há evidências experimentais que as pessoas violam os axiomas da teoria da utilidade
![Page 95: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/95.jpg)
98 / 161
Escolha A ou B
A: 80% de chance de ganhar $4000
B: 100% de chance de ganhar $3.000
![Page 96: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/96.jpg)
99 / 161
Escolha C ou D
C: 20% de chance de ganhar $4000
D: 25% de chance de ganhar $3.000
![Page 97: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/97.jpg)
100 / 161
Supondo U(0)=0 Se maioria escolhe B em detrimento de A e C em
detrimento de D,
De A e B, temos que 0,8*U(4000)<U(3000)
De C e D temos que 0,8U(4000)>U(3000)
Contraditório!!!!
![Page 98: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/98.jpg)
101 / 161
Teorias alternativas Em linhas gerais as pessoas divergem da teoria da
maximização da utilidade esperada em situações de probabilidade muito alta e/ou muito baixa
Há algumas teorias alternativas que se propõem a descrever o comportamento humano real. Uma das mais relevantes foi proposta por Kahneman e Tversky. Esta teoria propõe um modelo alternativo que descreve esse efeito “certeza” e outros
![Page 99: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/99.jpg)
102 / 161
Decisões [Racionais] com Redes Bayesianas
Preferências Racionais
Utilidades x Dinheiro
Redes de Decisão
Classificação e Avaliação de classificadores
![Page 100: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/100.jpg)
103 / 161
Decision Networks By now we know how to use Bayesian networks to
represent uncertainty and do probabilistic inference.
Now, we extend them to support decision making adding an explicit representation of both the actions under consideration and the value or utility of the resultant outcomes gives us decision networks (also called influence diagrams by Howard and Matheson, 1981).
Bayesian decision networks combine probabilistic reasoning with utilities, helping us to make decisions that maximize the expected utility,…
![Page 101: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/101.jpg)
104 / 161
Principle of Expected Utility The principle of maximum expected utility asserts that an
essential part of the nature of rational agents is to choose that action which maximizes expected utility.
In some cases U(Oi | A) = U(Oi )
![Page 102: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/102.jpg)
105 / 161
Decision Network Node types
![Page 103: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/103.jpg)
106 / 161
Rede de Decisão Nós de acaso: (elipses) representam variáveis aleatórias.
Cada nó de acaso tem um distribuição de probabilidade condicional (dados os nós pais)
Nós de Decisão : (retângulos) representam as possíveis ações
Nós de utilidade: (losangos) representam as preferências do agente e podem ser usadas para definir as ações através da seleção da ação que maximiza a utilidade esperada
![Page 104: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/104.jpg)
107 / 161
Assume that there is 30% of raining and in that case Melbourne has 60% of wining, but only 25% if it is not wet…
Make your decision network! Variables, conditional dependence, action and utility node
![Page 105: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/105.jpg)
108 / 161
Possible solution…
![Page 106: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/106.jpg)
109 / 161
Evaluating Decision Networks
![Page 107: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/107.jpg)
110 / 161
Estimating Expected Utility Without evidence added, the probability of Melbourne
winning is
And:
![Page 108: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/108.jpg)
111 / 161
Outro Exemplo: Escolha da localização de um aeroporto Dependendo da posição pode-se alterar:
O risco de acidentes (logo, o número esperado de mortes.. Deaths
O incômodo causado pelo barulho dos aviões, quanto mais próximo de uma cidade pior….Noise
É fácil perceber que Deaths e Noise serão diretamente afetados pelo volume de tráfego aéreo no aeroporto.
Naturalmente, o custo também é alterado pela localização do aeroporto (Cost) a desapropriação de um determinado terreno pode ser mais ou menos
litigioso….e os custos de ligação de transportes do aeroporto a cidade podem ser maiores ou menores afetando a construção
![Page 109: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/109.jpg)
112 / 161
Decision Network
![Page 110: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/110.jpg)
113 / 161
Podemos determinar distribuições de variáveis, mas como decidir? Nós de ação e nós de utilidade na rede;
![Page 111: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/111.jpg)
114 / 161
Processo de Decisão… pi = P(deaths=i| ASite=s, Noise=n) Ou
P(outcome| action,evidence)
Utilidade Esperada (action=a) = ∑i U(outcomei)*P(outcome i|action=a,evidence)
Escolher ação que maximiza a utilidade esperada
![Page 112: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/112.jpg)
115 / 161
Decisões com Redes Bayesianas Preferências Racionais
Utilidades x Dinheiro
Redes de Decisão Redes de Decisão e Decisão Sequenciada
Modelo Decisório de Markov
![Page 113: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/113.jpg)
116 / 161
Information Links: When a variable need to be observed There may be arcs from chance nodes to decision nodes
— these are called information links (Jensen and Nielsen, 2007, p. 305).
These links indicate when a chance node needs to be observed before the decision D is made — but after any decisions prior to D.
With an information link in place, network evaluation can be extended to calculate explicitly what decision should be made, given the different values for that chance node.
![Page 114: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/114.jpg)
117 / 161
Information Link: Example To illustrate the use of information links, let’s use again
the Melbourne football team example, but now Clare was only going to decide whether to accept the bet or not after she heard the weather forecast
Previously :
![Page 115: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/115.jpg)
118 / 161
Previously Clare decided don’t accept the bet What if there is a reasonable Forecast about the weather? How
to change the network?
![Page 116: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/116.jpg)
119 / 161
Introducing the New Node, Information Link and Decision Table
![Page 117: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/117.jpg)
120 / 161
Decision Table Algorithm (single decision node, with information Link)
![Page 118: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/118.jpg)
121 / 161
Decision Table obtained by following the algorithm EU(AB=yes | F=rainy) = P(R=melb_wins| F=rainy) x
U(R=melb_wins| AB=yes,F=rainy)+ P(R=melb_loses| F=rainy) x U(R=melb_loses| AB=yes,F=rainy)
EU(AB=no | F=rainy) = P(R=melb_wins| F=rainy) x U(R=melb_wins| AB=no, F=rainy)+ P(R=melb_loses| F=rainy) x U(R=melb_loses| AB=no, F=rainy)
Analogus to other values of F…..
![Page 119: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/119.jpg)
122 / 161
Decision Table with recorded actions (highest expected utility)
![Page 120: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/120.jpg)
123 / 161
Another Example: Fever
Decision network?
Variables: Fever, Flu, Therm, Reaction, FeverLater?
Decision: Take aspirin
Utility function: What is relevant to the utility function?
![Page 121: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/121.jpg)
124 / 161
A Decision Network for the Fever example
The action influences chance nodes, instead of the utility node !!!
![Page 122: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/122.jpg)
125 / 161
Decision Table obtained by following the algorithm
![Page 123: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/123.jpg)
126 / 161
Types of Actions There are two main types of actions in decision problems,
intervening and nonintervening. Non-intervening actions do not have a direct effect on
the chance variables being modeled, as in the Football team example.
Intervening actions do have direct effects on the world, in the fever example, deciding to take aspirin will affect the later fever situation.
![Page 124: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/124.jpg)
127 / 161
Types of actions
![Page 125: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/125.jpg)
Decision Making with Bayesian Networks
Prof. Paulo André Castro [email protected]/~pauloac Sala 110, IEC-ITA
![Page 126: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/126.jpg)
129 / 161
Sequential Decision Making Thus far, we have considered only single decision problems. Often however
a decision maker has to select a sequence of actions, or a plan. Sometimes, a sequence of action is not enough and it is required a function given observations
In the football decision problem used before, Clare might have a choice as to whether to obtain the weather forecast (perhaps by calling the weather bureau).
In the diagnostics example, the physician must decide whether to order another exam, before deciding on a treatment option.
This type of decision problem has two stages: 1. The decision whether to run a test or make an observation 2. The selection of a final action
![Page 127: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/127.jpg)
130 / 161
A decision network showing the general structure for these test-act decision sequences….
![Page 128: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/128.jpg)
131 / 161
Test-action Decision Sequence If the decision is made to run the test, evidence will be
obtained for the observation node Obs, before the Action decision is made; hence there is an information link from Obs to Action
And if we decide do not to run the test. ? This situation is handled by adding an additional state, unknown, to the Obs node and setting the CPT for Obs
![Page 129: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/129.jpg)
132 / 161
Test-action Decision Sequence - 2 In this generic network, there are arcs from the
Action node to both the chance node X and the utility node U, indicating intervening actions with a direct associated cost. However, either of these arcs may be omitted, representing a non-intervening action or one with no direct cost, respectively
There is an implicit assumption of no-forgetting in the semantics of a decision network. The decision maker remembers the past observations and decisions, indicated explicitly by the information and precedence links
![Page 130: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/130.jpg)
133 / 161
Algorithm for Test-action Decision Sequence
![Page 131: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/131.jpg)
134 / 161
Real estate investment example Your friend is thinking about buying a house as an investment. While it looks fine
externally, he knows that there may be structural and other problems..
He estimates that there is a 70% chance that the house is really in good condition, with a 30% chance that it could be a real dud
He plans to resell the house after doing some renovation and estimates that if the house really is in good condition (i.e., structurally sound), he should make a $5,000 profit, but if it isn’t, he will lose about $3,000 on the investment
He knows that he can get a building contractor to do a full inspection for $600. He also knows that the inspection report may not be completely accurate. He estimates 5% of Bad report for a good house, and 10% of Good report for a Bad house.
The questions are:
Is it worth it to have the building inspection done?
.. and then he should buy the house or not?.
Exercise: Build The Decision Network !!!
![Page 132: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/132.jpg)
135 / 161
A Decision Network
![Page 133: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/133.jpg)
136 / 161
Evaluating by Decision tree When Your friend decides about Inspection, he doesn’t have any information about
the chance nodes, so there are no information links entering the Inspect decision node.
When he decides whether or not to buy, he will know the outcome of that decision hence the information link from Report to BuyHouse.
The temporal ordering of his decisions, first about the inspection, and then whether to buy, is represented by the precedence link from Inspect to BuyHouse.
Note that there is a directed path from Inspect to BuyHouse (via Report) so even if there was no explicit precedence link added by the knowledge engineer for this problem, the precedence could be inferred from the rest of the network structure
![Page 134: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/134.jpg)
137 / 161
Evaluation using a decision tree model In order to show the evaluation of the decision network,
we will use a decision tree representation for the problem
To understand a decision tree, we start with the root node, which in this case is the first decision node, whether or not to inspect the house. Taking the path from the root to leaves each path means: From a decision node, it indicates which decision is made From a chance node, it indicates which value has been
observed
![Page 135: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/135.jpg)
138 / 161
I: Inspect the house BH: Buy the house C: Condition R: Report
Note: We could include
R=unknown, when I=no
But it wouldn’t change
anything
![Page 136: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/136.jpg)
139 / 161
How to decide? Decision Tree Evaluation Algorithm
![Page 137: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/137.jpg)
140 / 161
Evaluated Decision Tree ExpectedUtilities areshown underlined
![Page 138: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/138.jpg)
141 / 161
Decisions and their Expected Utilities
The report may change the decision of buying the house!
![Page 139: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/139.jpg)
142 / 161
Value of information The decision of whether to gather new information is
based on the value of the information or Expected Benefit
In the real estate investment problem,
Note that it already computes the cost of the inspection. So the price is worth paying
![Page 140: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/140.jpg)
143 / 161
Sequential Decision Making Sequential Decision Making may be approached using
another type of Graph Probabilistic Model (Modelos Probabilísticos em Grafos) Markov Chain (Redes ou Cadeias de Markov)
Sequential Decision making is complex in Bayesian Networks, one way of dealing with it is using Dynamic Bayesian Network (DBN) which is going to be our next subject
![Page 141: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/141.jpg)
Dynamic Bayesian networks
![Page 142: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/142.jpg)
145 / 161
Dynamic Bayesian networks DBN are also called dynamic belief networks (Russell and
Norvig, 1995, Nicholson, 1992), probabilistic temporal networks (Dean and Kanazawa, 1989, Dean and Wellman, 1991) and dynamic causal probabilistic networks (Kjærulff, 1992).
Dynamic Bayesian networks (DBNs) explicitly model change over time.
After, we will extend these DBNs with decision and utility nodes, to give dynamic decision networks, which are a general model for sequential decision making or planning under uncertainty.
![Page 143: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/143.jpg)
146 / 161
Bayesian Networks and time Although a causal relationship represented by an arc implies a temporal
relationship, BNs do not explicitly model temporal relationships between variables.
And the only way to model the relationship between the current value of a variable, and its past or future value, is by adding another variable with a different name. We saw an example of this with the fever example earlier with the use of the FeverLater node.
![Page 144: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/144.jpg)
147 / 161
BN and time A Bayesian network is defined by a set of random variable and
arcs connecting them
When constructing a DBN for modeling changes over time, we include one node for each Xi for each time step. If the current time step is represented by t, the previous time step by t-1, and the next time step by t +1, then the corresponding DBN nodes will be:
![Page 145: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/145.jpg)
148 / 161
Dynamic Bayesian Network The relationships between variables in a time-slice are
represented by intra-slice arcs, Although it is not a requirement, the structure of a time-slice does not usually change over time
The relationships between variables at successive time steps are represented by inter-slice arcs, also called temporal arcs, including relationships between the same variable over time, i.e: Xi
t Xit+1
![Page 146: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/146.jpg)
149 / 161
General structure of a Dynamic Bayesian Network
Note that there are no arcs that span more than a single time step. This is another example of the Markov assumption
![Page 147: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/147.jpg)
150 / 161
Variables and their relations intra-slice and inter-slice
Given the usual restriction that the networks for each time slice are exactly the same and that the changes over time also remain the same (i.e., both the structure and the CPTs are unchanging), a DBN can be specified very compactly. The specification must include: Node names
Intra-slice arcs
Temporal (inter-slice) arcs
CPTs for the first time slice t0 (when there are no parents from a previous time)
CPTs for t +1 slice (when parents may be from t or t +1 time-slices).
![Page 148: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/148.jpg)
151 / 161
The Fever Aspirin Example
![Page 149: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/149.jpg)
152 / 161
DBN Fever Aspirin Example
![Page 150: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/150.jpg)
153 / 161
Reasoning in DBN Given evidence about a set of nodes, from the first time slice up to and
including the current time-slice t, we can perform belief updating on the full DBN, using standard BN inference algorithms.
This means obtaining new posterior distributions for all the non-evidence nodes, including nodes in the t+1 and later time-slices. This updating into the future is called probabilistic projection
However, this type of DBN gets very large, very quickly, especially if the interval between time slices is short. To cope, in most cases the DBN is not extended far into the future. Instead, a fixed size, sliding “window” of time slices is maintained.
![Page 151: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/151.jpg)
154 / 161
DBN and sliding “window” of two time-slices (Shading indicates evidence node.)
![Page 152: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/152.jpg)
155 / 161
Sliding window… As the reasoning process moves forward with time, one
older time slice is dropped off the DBN, while another is added.
This use of a window means that every time we move the window along, the previous evidence received is no longer directly available. Instead, it is summarized taking the current belief for (root) nodes, and making these distributions the new priors
The DBN updating process is given in Algorithm 4.5. Note that the steps of this DBN updating algorithm are exactly those of a technique used in classical control theory, called a Kalman Filter
![Page 153: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/153.jpg)
156 / 161
DBN updating process
![Page 154: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/154.jpg)
157 / 161
Inference in DBN Exact clustering algorithms can be applied to DBNs,
particularly if the inference is restricted to two time-slices
Unfortunately, it is common that there is a cluster containing all the nodes in a time slice with inter-slice connections, so the clusters become hard computationally
![Page 155: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/155.jpg)
158 / 161
Dynamic decision networks Just as Bayesian networks can be extended with a
temporal dimension to give DBNs, so can decision networks be extended to give dynamic
decision networks (DDNs).
![Page 156: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/156.jpg)
159 / 161
A DDN for the Fever problem
![Page 157: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/157.jpg)
160 / 161
Mobile Robot Example
The problem of a mobile robot that does localization and tracking can be modeled with a DDN as follows: The nodes ST and SR represent the locations of the target and the robot, respectively
The decision node is M, representing the robot’s movement actions options
The nodes OR and OT represent the robot’s observations of its own and the target’s location, respectively
The overall utility is the weighted sum over time of the utility at each step Ut , which is a measure of the distance between the robot and its target.
![Page 158: Introdução a Inteligência Artificialpauloac/pee/IntroIA.pdfO termo Inteligência Artificial foi usado oficialmente pela primeira vez no verão de 1956, em um convite para um workshop](https://reader035.fdocuments.es/reader035/viewer/2022062306/5f7afe21c30201465c201005/html5/thumbnails/158.jpg)
161 / 161
Mobile Robot Example