[英]How to use MLFlow in a functional style / functional programming?
Is there a reliable way to use MLFlow in a functional style?有没有可靠的方法以函数式风格使用 MLFlow? As it is not possible to pass the run ID for example to the function which logs a parameter, I wonder whether it is possible to seperate code executed in my MLFLow run into multiple pure fuctions.
由于无法将运行 ID 传递给记录参数的 function,我想知道是否可以将在我的 MLFLow 运行中执行的代码分成多个纯函数。 Have I overlooked something, or is it simply not possible?
我是否忽略了什么,或者根本不可能?
So far I have looked up the documentation and did not find a way to pass the run id to a MLFlow log function, neither for parameters, nor metrics or anything else.到目前为止,我已经查阅了文档,但没有找到将运行 ID 传递给 MLFlow 日志 function 的方法,无论是参数、指标还是其他任何东西。
https://mlflow.org/docs/latest/python_api/mlflow.client.html#mlflow.client.MlflowClient.log_param https://mlflow.org/docs/latest/python_api/mlflow.client.html#mlflow.client.MlflowClient.log_param
log_param(run_id: str, key: str, value: Any) log_param(run_id:str,键:str,值:任何)
The solution is to use the mlflow.client module instead of the mlflow module as stated in the documentation of the mlflow client:解决方案是使用 mlflow.client 模块而不是 mlflow 客户端文档中所述的 mlflow 模块:
The mlflow.client module provides a Python CRUD interface to MLflow Experiments, Runs, Model Versions, and Registered Models.
mlflow.client 模块为 MLflow 实验、运行、Model 版本和注册模型提供 Python CRUD 接口。 This is a lower level API that directly translates to MLflow REST API calls.
这是一个较低级别的 API,直接转换为 MLflow REST API 调用。 For a higher level API for managing an “active run”, use the mlflow module.
对于用于管理“活动运行”的更高级别 API,请使用 mlflow 模块。
@Andre: Thanks for pointing me in the right direction. @Andre:感谢您为我指明正确的方向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.