This is how I render the tree:
First make a model after you have done all the preprocessing, splitting, etc.:
# max number of trees = 100 from sklearn.ensemble import RandomForestClassifier classifier = RandomForestClassifier(n_estimators = 100, criterion = 'entropy', random_state = 0) classifier.fit(X_train, y_train)
Make predictions:
Then plot the values. The dataset variable is the name of the source frame.
# get importances from RF importances = classifier.feature_importances_
This gives a graph as shown below:

source share