Skip to content

Commit 64a5d00

Browse files
committed
Add assert: gibbs_ask can't handle X in e, either.
1 parent c6f81c5 commit 64a5d00

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

probability.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ def gibbs_ask(X, e, bn, N):
439439
... ).show_approx()
440440
'False: 0.738, True: 0.262'
441441
"""
442+
assert X not in e, "Query variable must be distinct from evidence"
442443
counts = dict((x, 0) for x in bn.variable_values(X)) # bold N in Fig. 14.16
443444
Z = [var for var in bn.vars if var not in e]
444445
state = dict(e) # boldface x in Fig. 14.16

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy