搜索模型
随着 MLflow Model Registry 的规模增长,并且您与其他用户协作,您需要能够在 Model Registry 中按条件搜索模型。
在本练习中,您将创建两个过滤字符串,用来在 MLflow Model Registry 中搜索模型。第一个过滤字符串用于查找所有 "Insurance" 模型,第二个过滤字符串用于查找非 "Insurance" 模型。
使用相同的 MLflow Model Registry,其他协作者已经创建了一些模型,并且 MLflow Client 模块的实例已设置为 client。
client = mlflow.MlflowClient()
MLflow Client 模块将被导入。
本练习是课程的一部分
MLflow 入门
练习说明
- 创建一个过滤字符串,查找所有名称以
'Insurance'为前缀的模型。 - 使用
insurance_filter_string在 Model Registry 中搜索。 - 创建一个过滤字符串,查找名称 不等于
'Insurance'的模型。 - 使用变量
not_insurance_filter_string在 Registry 中执行搜索。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Insurance filter string
insurance_filter_string = "____ ____ '____'"
# Search for Insurance models
print(____.____(____=____))
# Not Insurance filter string
not_insurance_filter_string = "____ ____ '____'"
# Search for non Insurance models
print(____.____(____=____))