Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
1k views

Getting path error while Plotting decision tree, graphviz pydotplus

I'm executing the code below and getting the error following it - from IPython.display import Image from sklearn.tree import export_graphviz from six import StringIO import pydotplus features = list(...
Ankit Chawrai's user avatar
0 votes
2 answers
1k views

Error in Displaying Decision Tree in Jupyter Notebook

My Code : from IPython.display import Image from sklearn.externals.six import StringIO import pydotplus dot_data = StringIO() tree.export_graphviz(clf, out_file=dot_data, ...
Neo Biz 's user avatar
4 votes
1 answer
6k views

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 ...
user288609's user avatar
1 vote
1 answer
5k views

Using graphviz to plot decision tree in python

I am following the answer presented to a previous post: Is it possible to print the decision tree in scikit-learn? from sklearn.datasets import load_iris from sklearn import tree from sklearn....
Sjoseph's user avatar
  • 873
5 votes
2 answers
10k views

Color of the node of tree with graphviz using class_names

Expanding on a prior question: Changing colors for decision tree plot created using export graphviz How would I color the nodes of the tree bases on the dominant class (species of iris), instead of a ...
EngineeringAsArt's user avatar
1 vote
0 answers
748 views

pydotplus does not import -- trying to visualize gradient boosting tree

My goal is to visualize the results of a gradient boosting classifier. from sklearn.ensemble import GradientBoostingClassifier clf_gbc = GradientBoostingClassifier(random_state=42) pipe = Pipeline(...
Moiz Kapadia's user avatar
1 vote
1 answer
129 views

Visualizing RandomForestRegression trees

I have run a RandomForestRegression model in sklearn and saved the output of my decisions trees (n_estimators=50) into 50 .dot files. Now I want to save them so I can view them as actual trees. I am ...
Stefano Potter's user avatar
38 votes
7 answers
151k views

Plot trees for a Random Forest in Python with Scikit-Learn

I want to plot a decision tree of a random forest. So, i create the following code: clf = RandomForestClassifier(n_estimators=100) import pydotplus import six from sklearn import tree dotfile = six....
Zoya's user avatar
  • 1,215
7 votes
6 answers
24k views

Plotting decision tree, graphvizm pydotplus

I'm following the tutorial for decision tree on scikit documentation. I have pydotplus 2.0.2 but it is telling me that it does not have write method - error below. I've been struggling for a while ...
Jan Sila's user avatar
  • 1,593
1 vote
1 answer
2k views

Sckit learn with GraphViz exports empty outputs

I would like to export decision tree using sklearn. First I trained a decision tree classifier: self._selected_classifier = tree.DecisionTreeClassifier() self._selected_classifier.fit(...
Aviade's user avatar
  • 2,097
47 votes
10 answers
28k views

graph.write_pdf("iris.pdf") AttributeError: 'list' object has no attribute 'write_pdf'

My code is follow the class of machine learning of google.The two code are same.I don't know why it show error.May be the type of variable is error.But google's code is same to me.Who has ever had ...
乔守卿's user avatar
  • 583
5 votes
2 answers
6k views

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 ...
Zelphir Kaltstahl's user avatar
2 votes
3 answers
7k views

NameError: global name 'dot_parser' is not defined

I was playing with the decision tree algorithm and trying to plot the tree. However the IDE reported following error: Couldn't import dot_parser, loading of dot files will not be possible. <class '...
Wulipapa's user avatar
  • 105
1 vote
1 answer
477 views

scikit-learn: Decision tree

I am trying to train a decision tree with iris dataset from scikit-learn. I tried running the following command: from sklearn.datasets import load_iris from sklearn import tree clf = tree....
Priya's user avatar
  • 65
1 vote
3 answers
7k views

Python Decision Tree GraphViz

I'm attempting to implement a Decision Tree with scikit learn and then visualise the tree with Graphviz which I understand is the standard choice for visualising DT. I'm using PyCharm, anaconda, ...
OAK's user avatar
  • 3,156
3 votes
1 answer
3k views

"class_names" in export_graphviz unexpected keyword error

With the following code: classes = ['ham', 'spam'] dot_data = StringIO() with open("./plots/ritesh.dot", "w") as f: export_graphviz(dt_old.named_steps['classifier'], out_file=f, feature_names=...
Zangetsu's user avatar
  • 2,005
2 votes
1 answer
1k views

How do i draw decisiontree? (TypeError: startswith in graph from dot data, pydot)

I am new at working with Scikit Learn, machine learning, with Python. I was trying to work with a decision tree. I managed to do all the cleaning of the data, analysis and so on until I tried to get ...
ibarrau's user avatar
  • 388
2 votes
1 answer
2k views

Pydot error with sklearn decision tree graph

I am trying to use following code from sklearn (http://scikit-learn.org/stable/modules/tree.html): from sklearn.externals.six import StringIO import pydot dot_data = StringIO() tree.export_graphviz(...
user690462's user avatar
5 votes
2 answers
3k views

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 ...
CSquare's user avatar
  • 642
1 vote
0 answers
815 views

How identify left (True) and right (False) branch

I exported a scikit-learn DecisionTree to a .dot file with export_graphviz. In a different module I want to load the tree from the .dot file and fill a different tree structure. Question: How do I ...
ezdazuzena's user avatar
  • 6,710
75 votes
28 answers
175k views

Why is pydot unable to find GraphViz's executables in Windows 8?

I have GraphViz 2.32 installed in Windows 8 and have added C:\Program Files (x86)\Graphviz2.32\bin to the System PATH variable. Still pydot is unable to find its executables. Traceback (most recent ...
web_ninja's user avatar
  • 2,381