causaldag icon indicating copy to clipboard operation
causaldag copied to clipboard

Error in Simple Example

Open XinyiYS opened this issue 5 years ago • 1 comments

In the code provided in the readme for Simple Example, the line iv = dag.optimal_intervention(cpdag=cpdag) seems to cause an error due to missing function optimal_intervention().

Upon further investigation, I tried replacing this function with with dag.greedy_optimal_single_node_intervention() or dag.greedy_optimal_fully_orienting_interventions(), another error arises:

Traceback (most recent call last): icpdag = dag.interventional_cpdag([iv], cpdag=cpdag) "causaldag/causaldag/classes/dag.py", line 1660, in interventional_cpdag cut_edges.update({(i, j) for i, j in self._arcs if len({i, j} & set(iv_nodes)) == 1}) "causaldag/causaldag/classes/dag.py", line 1660, in cut_edges.update({(i, j) for i, j in self._arcs if len({i, j} & set(iv_nodes)) == 1}) TypeError: unhashable type: 'list'

XinyiYS avatar Sep 29 '20 05:09 XinyiYS

Replacing dag.optimal_intervention() with dag.optimal_fully_orienting_interventions() seems to solve the issue and give the specified answer.

Feel free to close this issue if that was correct.

XinyiYS avatar Sep 29 '20 06:09 XinyiYS