I am trying to visiualize my decisiontree.Below is the code which I have tried
from StringIO import StringIO
from sklearn import tree
out = StringIO()
clf =DecisionTreeClassifier(X,y)
out = tree.export_graphviz(clf, out_file=out)
print out.getvalue()
Below is the error which i am getting
AttributeError Traceback (most recent call last)
<ipython-input-33-7b068216688f> in <module>()
4
5 out = tree.export_graphviz(clf, out_file=out)
----> 6 print out.getvalue()
AttributeError: 'NoneType' object has no attribute 'getvalue'
How do I solve this?