Skip to content

Commit 3d3e90e

Browse files
authored
Update how-to-manage-models-mlflow.md
1 parent f4f4b9a commit 3d3e90e

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

articles/machine-learning/how-to-manage-models-mlflow.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Azure Machine Learning supports MLflow for model management. This represents a c
3131

3232
## Registering new models in the registry
3333

34+
The models registry offer a convenient and centralized way to manage models in a workspace. Each workspace has its own independent models registry. The following section explains multiple way to register models in the registry using MLflow SDK.
35+
3436
### Creating models from an existing run
3537

3638
If you have an MLflow model logged inside of a run and you want to register it in a registry, you can do that by using the run ID and the path where the model was logged. See [Manage experiments and runs with MLflow](how-to-track-experiments-mlflow.md) to know how to query this information if you don't have it.
@@ -72,6 +74,8 @@ mlflow.register_model(f"file://{model_local_path}", "local-model-test")
7274

7375
## Querying model registries
7476

77+
You can use the MLflow SDK to query and search for models registered in the registry. The following section explains multiple ways to achieve it.
78+
7579
### Querying all the models in the registry
7680

7781
You can query all the registered models in the registry using the MLflow client. The following sample prints all the model's names:
@@ -81,6 +85,12 @@ for model in client.search_registered_models():
8185
print(f"{model.name}")
8286
```
8387

88+
Use `order_by` to order by an specific property like `name`, `version`, `creation_timestamp`, and `last_updated_timestamp`:
89+
90+
```python
91+
client.search_registered_models(order_by=["name ASC"])
92+
```
93+
8494
> [!NOTE]
8595
> __MLflow 2.0 advisory:__ In older versions of Mlflow (<2.0), use method `MlflowClient.list_registered_models()` instead.
8696
@@ -114,7 +124,7 @@ You can load models directly from the registry to restore the models objects tha
114124
MLflow supports model's stages to manage model's lifecycle. Model's version can transition from one stage to another. Stages are assigned to a model's version (instead of models) which means that a given model can have multiple versions on different stages.
115125

116126
> [!IMPORTANT]
117-
> Stages can only be accessed using the MLflow SDK. They don't show up in the [Azure Machine Learning Studio portal](https://ml.azure.com) and can't be retrieved using neither Azure Machine Learning SDK, Azure Machine Learning CLI, or Azure Machine Learning REST API. Creating deployment from a given model's stage is not supported by the moment.
127+
> Stages can only be accessed using the MLflow SDK. They don't show up in the [Azure ML Studio portal](https://ml.azure.com) and can't be retrieved using neither Azure ML SDK, Azure ML CLI, or Azure ML REST API. Creating deployment from a given model's stage is not supported by the moment.
118128
119129
### Querying model stages
120130

@@ -162,7 +172,7 @@ model = mlflow.pyfunc.load_model(f"models:/{model_name}/Staging")
162172

163173
## Editing and deleting models
164174

165-
Editing registered models is supported in both Mlflow and Azure Machine Learning. However, there are some differences important to be noticed:
175+
Editing registered models is supported in both Mlflow and Azure ML. However, there are some differences important to be noticed:
166176

167177
> [!WARNING]
168178
> Renaming models is not supported in Azure Machine Learning as model objects are immmutable.
@@ -200,15 +210,15 @@ client.delete_model_version(model_name, version="2")
200210
201211
## Support matrix for managing models with MLflow
202212

203-
The MLflow client exposes several methods to retrieve and manage models. The following table shows which of those methods are currently supported in MLflow when connected to Azure Machine Learning. It also compares it with other models management capabilities in Azure Machine Learning.
213+
The MLflow client exposes several methods to retrieve and manage models. The following table shows which of those methods are currently supported in MLflow when connected to Azure ML. It also compares it with other models management capabilities in Azure ML.
204214

205-
| Feature | MLflow | Azure Machine Learning with MLflow | Azure Machine Learning CLIv2 | Azure Machine Learning Studio |
215+
| Feature | MLflow | Azure ML with MLflow | Azure ML CLIv2 | Azure ML Studio |
206216
| :- | :-: | :-: | :-: | :-: |
207217
| Registering models in MLflow format | **&check;** | **&check;** | **&check;** | **&check;** |
208218
| Registering models not in MLflow format | | | **&check;** | **&check;** |
209219
| Registering models from runs outputs/artifacts | **&check;** | **&check;**<sup>1</sup> | **&check;**<sup>2</sup> | **&check;** |
210220
| Registering models from runs outputs/artifacts in a different tracking server/workspace | **&check;** | | **&check;**<sup>5</sup> | **&check;**<sup>5</sup> |
211-
| Listing registered models | **&check;** | **&check;** | **&check;** | **&check;** |
221+
| Search/list registered models | **&check;** | **&check;** | **&check;** | **&check;** |
212222
| Retrieving details of registered model's versions | **&check;** | **&check;** | **&check;** | **&check;** |
213223
| Editing registered model's versions description | **&check;** | **&check;** | **&check;** | **&check;** |
214224
| Editing registered model's versions tags | **&check;** | **&check;** | **&check;** | **&check;** |
@@ -223,8 +233,8 @@ The MLflow client exposes several methods to retrieve and manage models. The fol
223233
> [!NOTE]
224234
> - <sup>1</sup> Use URIs with format `runs:/<ruin-id>/<path>`.
225235
> - <sup>2</sup> Use URIs with format `azureml://jobs/<job-id>/outputs/artifacts/<path>`.
226-
> - <sup>3</sup> Registered models are immutable objects in Azure Machine Learning.
227-
> - <sup>4</sup> Use search box in Azure Machine Learning Studio. Partial match supported.
236+
> - <sup>3</sup> Registered models are immutable objects in Azure ML.
237+
> - <sup>4</sup> Use search box in Azure ML Studio. Partial match supported.
228238
> - <sup>5</sup> Use [registries](how-to-manage-registries.md).
229239
230240
## Next steps

0 commit comments

Comments
 (0)