# 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
:
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.