Skip to content

Commit dfa50c2

Browse files
Added Tests for enumerate_joint
1 parent af47548 commit dfa50c2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_probability.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ def test_event_values():
6565
assert event_values((1, 2), ['C', 'A']) == (1, 2)
6666

6767

68+
def test_enumerate_joint():
69+
P = JointProbDist(['X', 'Y'])
70+
P[0, 0] = 0.25
71+
P[0, 1] = 0.5
72+
P[1, 1] = P[2, 1] = 0.125
73+
assert enumerate_joint(['Y'], dict(X=0), P) == 0.75
74+
assert enumerate_joint(['X'], dict(Y=2), P) == 0
75+
assert enumerate_joint(['X'], dict(Y=1), P) == 0.75
76+
77+
6878
def test_enumerate_joint_ask():
6979
P = JointProbDist(['X', 'Y'])
7080
P[0, 0] = 0.25

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