Am using the following code to extract rules. Please help me plot a tree of higher resolution as the image gets blurred when I increase the tree depth.
from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
classifier = DecisionTreeClassifier(max_depth = 3,random_state = 0)
tree.plot_tree(classifier);
Also, how can I extract rule from a random Forest Classifier.
Also are there
I'd just save the plot to a PDF file and use that to zoom in to whichever part you want
just put plt.savefig('out.pdf') after your call to plot_tree and matplotlib should do the right thing
note that any "vector" image format will do the right thing here, so a svg file would also be a fine choice as image editors tend to support zooming more nicelyer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With