From 2f4de4ae0b28e0e5ee2a5be6955366267fbc2404 Mon Sep 17 00:00:00 2001 From: Cathy Yeh Date: Tue, 12 Dec 2017 14:27:11 -0800 Subject: init Bernoulli And,Or CPDs w/ default state names 'False','True' --- beliefs/factors/bernoulli_and_cpd.py | 3 ++- beliefs/factors/bernoulli_or_cpd.py | 3 ++- 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 -- cgit v1.2.3