I would like to update previous runs done with MLFlow, ie. changing/updating a parameter value to accommodate a change in the implementation. Typical uses cases:
It is not always easy to trash the whole experiment as I need to keep the previous runs for statistical purpose. I would like also not to generate new experiments just for a single new parameter, to keep a single database of runs.
What is the best way to do this?
To add or correct a parameter, metric or artifact of an existing run, pass run_id instead of experiment_id to mlflow.start_run function
with mlflow.start_run(run_id="your_run_id") as run:
mlflow.log_param("p1","your_corrected_value")
mlflow.log_metric("m1",42.0) # your corrected metrics
mlflow.log_artifact("data_sample.html") # your corrected artifact file
You can correct, add to, or delete any MLflow run any time after it is complete. Get the run_id either from the UI or by using mlflow.search_runs.
Source: https://towardsdatascience.com/5-tips-for-mlflow-experiment-tracking-c70ae117b03f
MLflow API does not support updating an existing parameter value, see this.
However, there are backdoors you can use to achieve the goal of rewriting an existing parameter's value. But use with caution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With