upura / ayniy

Ayniy, All You Need is YAML

Home Page:https://upura.github.io/ayniy-docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Save feature importance figures to mlflow

upura opened this issue · comments

You can use log_figure instead of log_image to log figures (matplotlib or plotly). This is a bit confusing but log_image logs an object that represents an image (e.g. numpy array).

# matplotlib workflow

# plt.xxx style
plt.plot(...)
mlflow.log_figure(plt.gcf(), "figure.png")

# ax.xxx style
fig, ax = plt.subplots()
ax.plot(...)
mlflow.log_figure(fig, "figure.png")

Oh, I didn't know that. Thanks for pointing out.