You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
model_to_graphviz is a great visualization tool, but it currently does not draw edges to interaction terms. Nodes with names that contain a colon are not connected to the model graph because graphviz does not understand how to draw the edges.
Calls to graphviz from PyMC3 are translated into DOT and that language standard treats colons as a special character. When the graph is drawn and the instructions for drawing the edges are parsed, having a colon in one of the node names causes graphviz to look for a non-existent node to connect the edge to. This leads to missing edges in the graph and graphviz will issue a warning, but neither graphviz nor PyMC3 throws an exception.
Thanks for reporting thid @jvparidon. It seems like this should be easy to fix by inserting the names in quotes, or somehow escaping the colon in the names. Would you be interested in trying to address this with a PR?
Unfortunately, graphviz appears to parse colons in node names even if the names are in quotes, this is a known issue. The recommended workaround is to just remove colons from the node names but leave them in the node labels which will be drawn in the graph.
A string replace in the node name to replace colons with some other character before passing them to graphviz does indeed work, and seems like the easiest fix to me. I'll submit a PR.
Problem description
model_to_graphviz
is a great visualization tool, but it currently does not draw edges to interaction terms. Nodes with names that contain a colon are not connected to the model graph because graphviz does not understand how to draw the edges.Calls to graphviz from PyMC3 are translated into DOT and that language standard treats colons as a special character. When the graph is drawn and the instructions for drawing the edges are parsed, having a colon in one of the node names causes graphviz to look for a non-existent node to connect the edge to. This leads to missing edges in the graph and graphviz will issue a warning, but neither graphviz nor PyMC3 throws an exception.
Minimal working example
Versions and main components
The text was updated successfully, but these errors were encountered: