CS676/hw1
This is a python implementation of
Koller and Friedman (2009), "Probabilistic Graphical Models: Principles and Techniques" (page 75)
python d-separation.py -f your_input_file -n1 node1 -n2 node2 -ob given_observations
given_observations should be in the format of 'X1,X2,...'(no space).
Here I use a test case as in
Koller and Friedman (2009), "Probabilistic Graphical Models: Principles and Techniques" (page 76)
The graph looks like below and is described in example.py
For example,
python d-separation.py -f example.txt -n1 1 -n2 4 -ob 3
returns
False
means 1 and 4 are not d-separated given 3
python d-separation.py -f example.txt -n1 1 -n2 4 -ob 2,3
returns
True
means 1 and 4 not d-separated given 2, 3
sh run.sh
returns
False
True