Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sklearn tree visualization

from pydotplus import graph_from_dot_data
from sklearn.tree import export_graphviz
 
dot_data = export_graphviz(tree_reg1, filled=True, rounded=True,
                                    feature_names=predictors,
                                    out_file=None)
graph = graph_from_dot_data(dot_data)
graph.write_png('tree.png')
graph
 
PREVIOUS NEXT
Tagged: #sklearn #tree #visualization
ADD COMMENT
Topic
Name
9+4 =