125
1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

  • View
    216

  • Download
    1

Embed Size (px)

Citation preview

Page 1: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

1

Building Bayesian Networks

COMPSCI 276, Fall 2009

Set 3: Rina Dechter

(Reading: Darwiche chapter 5)

Page 2: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 3: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Queries: Different queries may be relevant for different scenarios

Page 4: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

For other tools see class page

Page 5: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Other type of evidence: We may want to know the probability that the patient has either apositive X-ray or dyspnoea, X =yes or D=yes.

Page 6: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 7: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 8: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

C= lung cancer

Page 9: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 10: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 11: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 12: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 13: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 14: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 15: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Building email management network

• Step 1: define the variables: email characteristics• Title,

• (values: any sequence of words.)

• sender-id,

• (values: # of id names)

• Recipients, #-of-recipients

• (Values, a sequence of id-names)

• topic,

• (values: a distribution over bag of words, or a set of key words)

• length,

• (values: natural numbers)

• time-sent : (time-of-week, time-of-day),

• (values: days of the week, time (discredized)

• time-read, (values: as above)

• current-time, (value: as above)

• max-reponse-time (value: as above)

Evidence variables

query

Page 16: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 17: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 18: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Variables? Arcs? Try it.

Page 19: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

What about?A naive Bayes structurehas the following edges C -> A1, . . . , C -> Am, where C is called the class variable and A1; : : : ;Am are called the attributes.

Page 20: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 21: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Learn the model from data

Page 22: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Learning the model

Page 23: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Try it: Variables and values? Structure? CPTs?

Page 24: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 25: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 26: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Try it: Variables? Values? Structure?

Page 27: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 28: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 29: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 30: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 31: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 32: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 33: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 34: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 35: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 36: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 37: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 38: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 39: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 40: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Variables? Values? Structure?

Page 41: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 42: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 43: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 44: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 45: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 46: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Try it: Variables, values, structure?

Page 47: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 48: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 49: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 50: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 51: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 52: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 53: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 54: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 55: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 56: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 57: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

What queries should we use here?

Page 58: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 59: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

WER (word error rate), BER (bit error rate)

MAP (MPE) minimize WER, PM minimize BER…What do you think?

Page 60: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 61: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 62: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 63: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 64: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Building email management network

• Step 1: define the variables: email characteristics• Title,

• (values: any sequence of words.)

• sender-id,

• (values: # of id names)

• Recipients, #-of-recipients

• (Values, a sequence of id-names)

• topic,

• (values: a distribution over bag of words, or a set of key words)

• length,

• (values: natural numbers)

• time-sent : (time-of-week, time-of-day),

• (values: days of the week, time (discredized)

• time-read, (values: as above)

• current-time, (value: as above)

• max-reponse-time (value: as above)

Evidence variables

query

Page 65: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Email network for a message

Title

Topic

Sender-id

recipients

MaxWait

Day-of-WeekTime-of-Day

Real-max-waitTime-now

time-left

#-of

Page 66: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Topic and title-subnetwork

Topic

Titlew1 w3w2 w1

w100

tw2tw1 tw3 tw4

Topics and titles will have a small number of categoriesWords are either present or not

Page 67: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Email network for a message

Title

Topic

Sender-id

recipients

MaxWait

Day-of-WeekTime-of-Day

Real-max-waitTime-now

time-left

#-of

Topic

Page 68: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

Slides 130-155 explain the domain.Read.

Variables, values, structure?

Page 69: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 70: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 71: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 72: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 73: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 74: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 75: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 76: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 77: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 78: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 79: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 80: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 81: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 82: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 83: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 84: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 85: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 86: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 87: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 88: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 89: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 90: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 91: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 92: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 93: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 94: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 95: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 96: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 97: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 98: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 99: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 100: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 101: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 102: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 103: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

153

Two Loci Inheritance

Recombinant

2 1A AB B

a ab b

A aB b 3 4

a ab b

A ab b 5 6

A aB b

Page 104: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

154

Bayesian Network for Recombination

S23m

L21fL21m

L23m

X21 S23f

L22fL22m

L23f

X22

X23

S13m

L11fL11m

L13m

X11 S13f

L12fL12m

L13f

X12

X13

y3

y2y1

{m,f}tssP tt

where

1

1),|( 1323

Locus 1

Locus 2

P(e|Θ) ?

Deterministic relationships

Probabilistic relationships

Page 105: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)

155

L11m L11f

X11

L12m L12f

X12

L13m L13f

X13

L14m L14f

X14

L15m L15f

X15

L16m L16f

X16

S13m

S15m

S16mS15m

S15m

S15m

L21m L21f

X21

L22m L22f

X22

L23m L23f

X23

L24m L24f

X24

L25m L25f

X25

L26m L26f

X26

S23m

S25m

S26mS25m

S25m

S25m

L31m L31f

X31

L32m L32f

X32

L33m L33f

X33

L34m L34f

X34

L35m L35f

X35

L36m L36f

X36

S33m

S35m

S36mS35m

S35m

S35m

Linkage analysis: 6 people, 3 markers

Page 106: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 107: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 108: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 109: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 110: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 111: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 112: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 113: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 114: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 115: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 116: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 117: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 118: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 119: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 120: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 121: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 122: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 123: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 124: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)
Page 125: 1 Building Bayesian Networks COMPSCI 276, Fall 2009 Set 3: Rina Dechter (Reading: Darwiche chapter 5)