【发布时间】:2017-03-15 05:59:44
【问题描述】:
我在 sklearn 中运行了一个 RandomForestRegression 模型,并将我的决策树 (n_estimators=50) 的输出保存到 50 个.dot 文件中。
现在我想保存它们,以便将它们视为实际的树。
我正在尝试这个:
import pydotplus
dot_data=r'F:\Sheyenne\Random_Forest\my_tree0.dot'
graph = pydotplus.graph_from_dot_data(dot_data)
graph.write_pdf(r'F:\Sheyenne\Random_Forest\my_tree0.pdf')
但这会返回:
AttributeError: 'NoneType' object has no attribute 'write_pdf'
【问题讨论】:
标签: scikit-learn pydot