获取在MLflow中创建模型的实验



我想获得包含创建注册MLflow模型的运行的实验的名称。如果我只有模型和版本的名称,我如何使用MLflow来做到这一点?

正如@Andre所说,我必须编写自己的函数来实现这一点,

def get_model_experiment(model_name, model_version):
# get run_id of the model version
run_id = mlflow_client.get_model_version(model_name, model_version).run_id
# get the experiment_id from the run_id
experiment_id = mlflow_client.get_run(run_id).info.experiment_id
# get the experiment name from the experiment_id
return mlflow_client.get_experiment(experiment_id).name

注册的模型版本有一个指向运行ID的指针。然后,您可以从运行中获得experiment_ID,并由此获得所有实验信息。查看API文档。

最新更新