I used this with my decision tree model on my database :
dot_data = tree.export_graphviz(pipeline.named_steps[\'classifier\'], out_file=None,