有没有办法通过 MLFlow API 设置默认图表

问题描述 投票:0回答:1

每次更改验证集(经常)时,我都会创建一个新的“实验”,但每次我都想要基本相同的图表。这是我在训练运行中进行相关比较的最简单方法。有没有办法通过 API 进行设置,这样我就不必每次都点击 UI?

machine-learning deep-learning mlflow mlops
1个回答
0
投票

如果您的意思是通过mlflow API“创建实验”,您可以查看以下页面:

https://mlflow.org/docs/latest/rest-api.html#create-experiment

2.0/mlflow/experiments/create

它会返回experiment_id,稍后可以使用。

Python 代码也支持:

import mlflow

mlflow.start_run()

experiment_name = "EXAMPLE"

experiment = mlflow.get_experiment_by_name(experiment_name)
if experiment is None:
    experiment_id = mlflow.create_experiment(experiment_name)
else:
    experiment_id = experiment.experiment_id

# log metrics
with mlflow.start_run(experiment_id=experiment_id):
    mlflow.log_metric("accuracy", 0.1)
    mlflow.log_artifact("path/to/artifact/file")

mlflow.end_run()
© www.soinside.com 2019 - 2024. All rights reserved.