Open priamai opened 1 year ago
Hi, the recommended way to assign labels to the nodes is 'cg.draw_pydot_graph(labels=[“A”, “B”, “C”])' or 'GraphUtils.to_pydot(cg.G, labels=[“A”, “B”, “C”])', as mentioned in the documentation. Here are some usage examples.
This visualizes the graph with assigned labels. But I'm not sure if you are looking for something else.
That is only for saving in pydot, I need to rewrite the actual node names for my downstream tasks and avoid confusion when referring to the original dataframe e.g. variable names.
@kunwuz for example when I add the Background Knowledge I want to do it by referring to the real node names defined in my ground truth NetworkX graph, instead now I have to go back and forward converting between the X{0} notation and the real variable names. Hope it makes better sense.
I see, that requires some refactorization of the graph classes in causal-learn. For now, it seems that creating a mapping/look-up table is the easiest way. We have put it on the list. Please also feel free to let me know if you have any suggestions or would like to improve it together.
This would be a useful feature. The noede names should be assignable.
Also, this argument, labels, would be useful on the method draw_nx_graph()
Hi there, I want to able to assign labels to the GeneralGraph similar to what you do with the GraphUtils instead of using the default X1...Xn notation.
This is what I tried:
Which looks good but I think it destroys the internal lookup table, when I want to see the edges it just complains of a keyerror:
Maybe I have to relabel the node_map? Any help will be appreciated.
I know you are working on supporting Pandas DataFrames directly but a short workaround will get me through this problem for the time being.