Skip to content

Instantly share code, notes, and snippets.

@patryk-oleniuk
Created May 10, 2020 09:44
Show Gist options
  • Save patryk-oleniuk/7f7937c9cace3b7a23b1af43e57834cc to your computer and use it in GitHub Desktop.
Save patryk-oleniuk/7f7937c9cace3b7a23b1af43e57834cc to your computer and use it in GitHub Desktop.
showing how to log folder structure in mlflow
"""
the output directory is prepared before logging:
├── output
│ ├── data
│ │ ├── data_sample.csv
│ │ └── data_sample.html
│ ├── images
│ │ ├── gif_sample.gif
│ │ └── image_sample.png
│ ├── maps
│ │ └── map_sample.geojson
│ └── plots
│ └── plot_sample.html
"""
### log files to mlflow experiment
with mlflow.start_run(experiment_id=1, run_name="folders") as run:
mlflow.log_param("parasmeter","test")
mlflow.log_metric("the_answer",42.0)
# if the logged artifact is a folder,
# then it will also show as a folder in mlflow
mlflow.log_artifact("./output/images")
mlflow.log_artifact("./output/plots")
mlflow.log_artifact("./output/data")
mlflow.log_artifact("./output/maps")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment