Philippe Martin
01/22/2025, 10:36 PMdef make_plotly():
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species",
size='petal_length', hover_data=['petal_width'])
fig.show()
return fig
And created a pipeline where the output of the associated node is stored in the catalog
plotly_fig:
type: kedro_mlflow.io.artifacts.MlflowArtifactDataset
dataset:
type: plotly.PlotlyDataset
filepath: data/08_reporting/plotly.json
plotly_args:
type: scatter
After running the pipeline, the fig properly shows up in a tab, then is stored in a json format. However, in mlflow ui, it only appears as the json file (see attached image).
• Is there a way to show the plotly fig in mlflow ? Do I miss something ?
• Also, what args would you recommend to save and load the plotly fig ?Hall
01/22/2025, 10:36 PMHuong Nguyen
01/23/2025, 7:55 AMmlflow.log_artifact
. it is stored in the artifact repository associated with the current MLflow run. These artifacts can then be viewed and downloaded from the MLflow UI. Perhaps this can help to visualise your plotly in MLFlow?
https://mlflow.org/docs/latest/traditional-ml/hyperparameter-tuning-with-child-runs/notebooks/logging-plots-in-mlflow.htmlPhilippe Martin
01/23/2025, 6:57 PMplotly_fig:
type: kedro_mlflow.io.artifacts.MlflowArtifactDataset
dataset:
type: plotly.PlotlyDataset
filepath: data/08_reporting/plotly.json
plotly_args:
type: scatter
Thank you for your helpPhilippe Martin
01/23/2025, 7:00 PMGuillaume Tauzin
01/24/2025, 10:38 AMmlflow.log_figure(figure=figure, artifact_file=f"{name}.html")
where figure is your plotly figure.
I am not just sure how it would work with the plotly dataset.Rashida Kanchwala
01/24/2025, 12:05 PMplotly.MLFlowDataset
dataset that would return the html as you said.Rashida Kanchwala
01/27/2025, 9:12 AMtype: kedro_mlflow.io.artifacts.MlflowArtifactDataset
dataset:
type: plotly.HTMLDataset
filepath: data/08_reporting/shuttle_passenger_capacity_plot_go.html
Philippe Martin
01/27/2025, 3:42 PM