aboutsummaryrefslogtreecommitdiff
path: root/beliefs/factors/bernoulli_and_cpd.py
diff options
context:
space:
mode:
Diffstat (limited to 'beliefs/factors/bernoulli_and_cpd.py')
-rw-r--r--beliefs/factors/bernoulli_and_cpd.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/beliefs/factors/bernoulli_and_cpd.py b/beliefs/factors/bernoulli_and_cpd.py
index fdb0c25..291398f 100644
--- a/beliefs/factors/bernoulli_and_cpd.py
+++ b/beliefs/factors/bernoulli_and_cpd.py
@@ -12,15 +12,17 @@ class BernoulliAndCPD(TabularCPD):
"""
def __init__(self, variable, parents=[]):
"""
- Args:
- variable: int or string
- parents: optional, list of int and/or strings
+ Args
+ variable: int or string
+ parents: list,
+ (optional) list of int and/or strings
"""
super().__init__(variable=variable,
variable_card=2,
parents=parents,
parents_card=[2]*len(parents),
- values=[])
+ values=None,
+ state_names={var: ['False', 'True'] for var in [variable] + parents})
self._values = None
@property