[英]No module named 'sklearn.externals.six'
# Import following modules and libraries to visualize the tree:
from sklearn.tree import DecisionTreeClassifier, export_graphviz
from sklearn.externals.six import StrinIO
import pydotplus
dot_data = StringIO()
export_graphviz(dtc, out_file="mytree.dot",feature_names=col[1:27],filled=True,rounded=True,special_characters=True)
graph= pydotplus.graph_from_dot_data(dot_data.getvalue())
sklearn.externals.six is deprecated You should be able to using StringIO by directly importing it from the module six
: sklearn.externals.six 已弃用您应该能够通过直接从模块six
导入 StringIO 来使用它:
from six import StringIO
As you did not provide an example to run the rest of your code, I don't know whether it will work由于您没有提供运行其余代码的示例,我不知道它是否会起作用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.