搜尋模型
隨著 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(____.____(____=____))