Closed qvhaelen closed 3 years ago
Hi @qvhaelen,
We currently don't have a built-in export method. However, since StructureModel
extends networkx.DiGraph
(see here), you can use networkx
's export method. For example, you can export to a .dot
file using write_dot function:
import networkx as nx
from causalnex.structure import StructureModel
# Create a model
sm = StructureModel()
sm.add_edges_from([
('A', 'C'),
('B', 'C'),
])
# Save the model into pygraphviz's dot format
nx.drawing.nx_pydot.write_dot(sm, 'graph.dot')
To export to other formats, you can find out more from networkx
's documentation. Hope this helps :)
Dear @oentaryorj thank you for the information. Yes I am already using the networkx functionalities so I guess it should be ok to export graph using networkx exprot function without relying on pygraphiz
Hello,
I would like to know if once the graph has been generated using DAGClassifier , is there a built-in mehod to export the structure of the graph, (edges, weight, nodes) in a column format so it can be visaulized using another custom tools?
Thank you