Questions tagged [pydot]

pydot is a Python module to serve as an easy interface to Graphviz's dot language.

For more information, check:

202 questions
5
votes
2 answers

sklearn.tree.export_graphviz alternatives

It is possible to visualize decision trees using pydotplus from pypi, but it has issues on my machine (it says it was not build with libexpat and thus it only shows a number on a node instead of a table with some information) and I'd like to use an…
Zelphir Kaltstahl
  • 5,722
  • 10
  • 57
  • 86
5
votes
1 answer

Drawing graph in graphviz layout in python using nx.draw_graphviz gives error

I am trying to draw a 100 node multi-graph G in graphviz layout in python's networkx so I made two trials so far: Trial 1 nx.draw_graphviz function as follows nx.draw_graphviz(G) but I get the following error repeated for all nodes in the…
Abdallah Sobehy
  • 2,881
  • 1
  • 15
  • 28
5
votes
2 answers

Visualizing scikit-learn/ sklearn multi-output decision tree regression in png or pdf

this is the first question I'm posting on stackoverflow so I apologize for any mishaps in layout and so on (advice welcome). Your help is much appreciated! I'm trying to visualize the output of DecisionTreeRegressor with multiple outputs (as…
CSquare
  • 624
  • 6
  • 16
5
votes
2 answers

Plotting a decision tree with pydot

I have trained a decision tree (Python dictionary) as below. Now I am trying to plot it using pydot. In defining each node of the tree (pydot graph), I appoint it a unique (and verbose) name and a brief label. My problem is that in the resulting…
Zhubarb
  • 11,432
  • 18
  • 75
  • 114
4
votes
1 answer

How do I add edges between two subgraphs in pydot?

Does anyone know how to add an edge between two subgraphs (clusters) in pydot? callgraph =…
user880219
  • 41
  • 1
  • 3
4
votes
2 answers

Keras: Assertion Error when plotting model

I want to plot my Keras model using the function below. Every time I try to do that, it gives me the following AssertionError. Can someone help? --------------------------------------------------------------------------- AssertionError …
Dominik
  • 41
  • 3
4
votes
1 answer

error message when using pydot to save image AttributeError: module 'os' has no attribute 'errno'

I am trying to use the following code segment to save a tree image generated from fitting a random forest model # Import tools needed for visualization from sklearn.tree import export_graphviz import pydot # Pull out one tree from the forest tree =…
user288609
  • 12,465
  • 26
  • 85
  • 127
4
votes
1 answer

Is it possible to change node size of a pydot graph?

I wrote a code to convert my MultiDiGraph() to a pydot graph to display self loops and arrows but after conversion, the pydot graph A has lost all the attributes of G. How can change the node size of graph A and set them equal to corresponding value…
Silvi Mantri
  • 41
  • 1
  • 3
4
votes
2 answers

AttributeError: module 'pydot' has no attribute 'graph_from_dot_data' in spyder

I am trying to run the following code: from sklearn.datasets import load_iris from sklearn import tree import pydot clf = tree.DecisionTreeClassifier() iris = load_iris() clf = clf.fit(iris.data, iris.target) from sklearn.externals.six import…
4
votes
1 answer

Python coding style - multiple return statements

For the same task, I have coded two different functions. I would like to know which one is more elegant to use. The task is to check a pydot object if it beholds a requested node, and if so, to return the node and the graph object back. If the node…
T-800
  • 1,543
  • 2
  • 17
  • 26
4
votes
2 answers

Pydot/Graphviz: How to order horizontally nodes in a Cluster while the rest of the graph is vertical

My question is in Pydot how can I set the node order in a cluster? My code is import pydot graph = pydot.Dot(graph_type='digraph', rankdir="LR") graphlegend = pydot.Cluster(graph_name="legend", label="Legend", fontsize="15", color="red",…
Jérémz
  • 383
  • 1
  • 5
  • 20
4
votes
2 answers

Python program can not import dot parser

I am trying to run a huge evolution simulating python software from the command line. The software is dependent on the following python packages: 1-networkX 2-pyparsing 3-numpy 4-pydot 5-matplotlib 6-graphviz The error I get is this: Couldn't…
Haider
  • 341
  • 3
  • 18
4
votes
2 answers

Make a graph in pydot from decision tree in sklearn Python

I expected this code to create a PDF graph of the tree. from sklearn import datasets,tree import StringIO import pydot from sklearn.externals.six import StringIO iris = datasets.load_iris() clf = tree.DecisionTreeClassifier() clf =…
skmathur
  • 1,587
  • 5
  • 14
  • 21
4
votes
1 answer

discover degree with pydot?

After a little work with pygraphviz I've returned to pydot. One of the useful methods in pygraphviz is iterdegree(). Can something analogous be done with pydot? ie: find the highest degree node so that I can set it as root? jjc
jjon
  • 680
  • 1
  • 8
  • 23
3
votes
1 answer

You must install pydot (`pip install pydot`) and install graphviz for plot_model to work

tf.keras.utils.plot_model(model, to_file='model.png', show_shapes=True, show_layer_names=True) ('You must install pydot (pip install pydot) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for…
hasu33
  • 1,891
  • 2
  • 4
  • 8
1 2
3
13 14