保存sklearn管道图

Jor*_*ier 5 python pipeline scikit-learn savefig

我想保存使用命令显示的管道set_config(display="diagram"),请参见下文:

图表

有没有比截图更好的方法?

Ben*_*ton 3

from sklearn.utils import estimator_html_repr

with open("pipeline.html", "w") as f:
    f.write(estimator_html_repr(pipeline))
Run Code Online (Sandbox Code Playgroud)