Save sklearn pipeline diagram

Question:

I want to save a pipeline displayed with the set_config(display="diagram") command, see below:

diagram

Is there a better way to do it than by taking a screenshot?

Asked By: Joris Limonier

||

Answers:

Maybe you can try the following approach
screenshot from twitter

Credit twitter link

Answered By: amalina_sulaiman
from sklearn.utils import estimator_html_repr

with open("pipeline.html", "w") as f:
    f.write(estimator_html_repr(pipeline))
Answered By: Benjamin Breton