我需要整个决策树图而不仅仅是一列

问题描述

代码返回特定列的决策树,但没有任何切片或仅将其留空允许我获得所有列的组合决策树。

from sklearn.tree import export_graphviz
import pydot


tree = classifier.estimators_[3]


export_graphviz(tree,out_file = 'tree.dot',feature_names = feature_list,rounded = True,precision = 1)

# Use dot file to create a graph
(graph,) = pydot.graph_from_dot_file('tree.dot')

# Write graph to a png file
graph.write_png('tree.png')

我知道这与此有关

    tree = classifier.estimators_[3]

我该怎么做?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)