I'm trying to graph my decision tree based on the article I found on DataCamp: https://www.datacamp.com/community/tutorials/decision-tree-classification-python. However, I'm getting an attribute error:
from sklearn.tree import export_graphviz
from sklearn.externals.six import StringIO
from IPython.display import Image
import pydotplus
decision_tree = DecisionTreeRegressor(max_depth=3)
decision_tree.fit(train_features, train_targets)
# Predict values for train and test
train_predictions = decision_tree.predict(train_features)
test_predictions = decision_tree.predict(test_features)
dot_data = StringIO()
export_graphviz(decision_tree, out_file=dot_data, filled=True, rounded=True, special_characters=True)
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())
graph.write_png('decision_tree.png')
Image(graph.create_png())
AttributeError: module 'pydotplus' has no attribute 'Node'
Has anyone any clue where should I look into?