aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCathy Yeh <cathy@driver.xyz>2017-12-12 14:27:11 -0800
committerCathy Yeh <cathy@driver.xyz>2017-12-13 18:45:03 -0800
commit2f4de4ae0b28e0e5ee2a5be6955366267fbc2404 (patch)
treecb99eb04b5ecf0f266466d9da97fbb8df77e0e65
parent76090e3f03c01e208d41203a6286ea432714090a (diff)
downloadbeliefs-2f4de4ae0b28e0e5ee2a5be6955366267fbc2404.tar.gz
beliefs-2f4de4ae0b28e0e5ee2a5be6955366267fbc2404.tar.bz2
beliefs-2f4de4ae0b28e0e5ee2a5be6955366267fbc2404.zip
init Bernoulli And,Or CPDs w/ default state names 'False','True'
-rw-r--r--beliefs/factors/bernoulli_and_cpd.py3
-rw-r--r--beliefs/factors/bernoulli_or_cpd.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/beliefs/factors/bernoulli_and_cpd.py b/beliefs/factors/bernoulli_and_cpd.py
index fdb0c25..adf5ed5 100644
--- a/beliefs/factors/bernoulli_and_cpd.py
+++ b/beliefs/factors/bernoulli_and_cpd.py
@@ -20,7 +20,8 @@ class BernoulliAndCPD(TabularCPD):
variable_card=2,
parents=parents,
parents_card=[2]*len(parents),
- values=[])
+ values=[],
+ state_names={var: ['False', 'True'] for var in [variable] + parents})
self._values = None
@property
diff --git a/beliefs/factors/bernoulli_or_cpd.py b/beliefs/factors/bernoulli_or_cpd.py
index 12ee2f6..6e01cf9 100644
--- a/beliefs/factors/bernoulli_or_cpd.py
+++ b/beliefs/factors/bernoulli_or_cpd.py
@@ -20,7 +20,8 @@ class BernoulliOrCPD(TabularCPD):
variable_card=2,
parents=parents,
parents_card=[2]*len(parents),
- values=[])
+ values=[],
+ state_names={var: ['False', 'True'] for var in [variable] + parents})
self._values = None
@property