I followed the the instructions in this thread to get my export working Python, PyDot and DecisionTree but a pdf export truncates the tree after a page width and the png is too small to read. Is there a way of creating a pdf with unlimited width?
My code is
from sklearn import tree
clf = tree.DecisionTreeClassifier().fit(X_train, y_train)
import pydotplus
from IPython.display import Image
from sklearn.externals.six import StringIO
dot_data = StringIO()
tree.export_graphviz(clf, out_file=dot_data,feature_names=cols_scaled.columns)
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())
Image(graph.create_png())
graph.write_pdf("decisiontree.pdf")
Many thanks