如何将以前的运行更新为MLFlow? [英] How to update a previous run into MLFlow?

查看:79
本文介绍了如何将以前的运行更新为MLFlow?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更新以前用MLFlow完成的运行.更改/更新参数值以适应实现中的更改.典型的使用案例:

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:

  • 使用参数A运行日志,然后使用参数A和B进行日志记录.使用其默认值更新先前运行的参数B的值将很有用.
  • 专业化"参数.使用布尔标志作为参数实现模型.更新实现以采用字符串代替.现在,我们需要更新先前运行的参数值,以使其与新行为保持一致.
  • 更正先前运行中记录的错误参数值.

丢弃整个实验并不总是那么容易,因为我需要保留先前的运行以用于统计目的.我也不想只为一个新参数生成一个新实验,以保持一个运行数据库.

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?

推荐答案

要添加或纠正现有运行的参数,度量或工件,请将run_id而不是Experiment_id传递给mlflow.start_run函数

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

完成后,您可以随时纠正,添加或删除任何MLflow运行.从用户界面或使用 mlflow.search_runs .

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.

来源: https://towardsdatascience.com/5-tips-for-mlflow-experiment-tracking-c70ae117b03f

这篇关于如何将以前的运行更新为MLFlow?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆