I am trying to display a design tree in a flask app. I am using pydotplus to create the image and it shows fine in my jupyter notebook. But I am not sure how to display the same in my flask application.
Here's the code to display the graph in jupyter notebook
dot_data = tree.export_graphviz(dt3, out_file=None, feature_names=data_train.columns, impurity=False,
filled=True,
proportion=True,
rounded=True)
graph = pydotplus.graph_from_dot_data(dot_data)
graph.create_png()
image = Image(graph.create_png())
image