Skip to content

Commit 129afa3

Browse files
committed
update doc
1 parent 2a4546b commit 129afa3

File tree

1 file changed

+9
-0
lines changed
  • docs/source/search_methods_index/Score-based causal discovery methods

1 file changed

+9
-0
lines changed

docs/source/search_methods_index/Score-based causal discovery methods/GES.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ Usage
1616
from causallearn.search.ScoreBased.GES import ges
1717
Record = ges(X, score_func, maxP, parameters)
1818
19+
# Visualization using pydot
20+
pyd = GraphUtils.to_pydot(Record['G'])
21+
tmp_png = pyd.create_png(f="png")
22+
fp = io.BytesIO(tmp_png)
23+
img = mpimg.imread(fp, format='png')
24+
plt.axis('off')
25+
plt.imshow(img)
26+
plt.show()
27+
1928
Visualization using pydot is recommended (`usage example <https://github.com/cmu-phil/causal-learn/blob/e4e73f8b58510a3cd5a9125ba50c0ac62a425ef3/tests/TestGES.py#L16>`_). If specific label names are needed, please refer to this `usage example <https://github.com/cmu-phil/causal-learn/blob/e4e73f8b58510a3cd5a9125ba50c0ac62a425ef3/tests/TestGraphVisualization.py#L106>`_ (e.g., GraphUtils.to_pydot(Record['G'], labels=["A", "B", "C"]).
2029

2130
Parameters

0 commit comments

Comments
 (0)