Skip to content

Commit 23c205d

Browse files
authored
Merge pull request #108026 from Blackmist/enhanced-registration
updating some examples to demonstrate setting metadata in tags
2 parents 4d479ba + e643ba3 commit 23c205d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

articles/machine-learning/how-to-deploy-and-where.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ A registered model is a logical container for one or more files that make up you
6464
> [!TIP]
6565
> When you register a model, you provide the path of either a cloud location (from a training run) or a local directory. This path is just to locate the files for upload as part of the registration process. It doesn't need to match the path used in the entry script. For more information, see [Locate model files in your entry script](#locate-model-files-in-your-entry-script).
6666
67-
Machine learning models are registered in your Azure Machine Learning workspace. The model can come from Azure Machine Learning or from somewhere else. The following examples demonstrate how to register a model.
67+
Machine learning models are registered in your Azure Machine Learning workspace. The model can come from Azure Machine Learning or from somewhere else. When registering a model, you can optionally provide metadata about the model. The `tags` and `properties` dictionaries that you apply to a model registration can then be used to filter models.
68+
69+
The following examples demonstrate how to register a model.
6870

6971
### Register a model from an experiment run
7072

@@ -80,7 +82,9 @@ The code snippets in this section demonstrate how to register a model from a tra
8082
+ Register a model from an `azureml.core.Run` object:
8183

8284
```python
83-
model = run.register_model(model_name='sklearn_mnist', model_path='outputs/sklearn_mnist_model.pkl')
85+
model = run.register_model(model_name='sklearn_mnist',
86+
tags={'area': 'mnist'},
87+
model_path='outputs/sklearn_mnist_model.pkl')
8488
print(model.name, model.id, model.version, sep='\t')
8589
```
8690

@@ -90,7 +94,8 @@ The code snippets in this section demonstrate how to register a model from a tra
9094

9195
```python
9296
description = 'My AutoML Model'
93-
model = run.register_model(description = description)
97+
model = run.register_model(description = description,
98+
tags={'area': 'mnist'})
9499

95100
print(run.model_id)
96101
```
@@ -102,7 +107,7 @@ The code snippets in this section demonstrate how to register a model from a tra
102107
+ **Using the CLI**
103108

104109
```azurecli-interactive
105-
az ml model register -n sklearn_mnist --asset-path outputs/sklearn_mnist_model.pkl --experiment-name myexperiment --run-id myrunid
110+
az ml model register -n sklearn_mnist --asset-path outputs/sklearn_mnist_model.pkl --experiment-name myexperiment --run-id myrunid --tag area=mnist
106111
```
107112

108113
[!INCLUDE [install extension](../../includes/machine-learning-service-install-extension.md)]

articles/machine-learning/how-to-deploy-existing-model.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: conceptual
99
ms.author: jordane
1010
author: jpe316
1111
ms.reviewer: larryfr
12-
ms.date: 11/06/2019
12+
ms.date: 03/17/2020
1313
---
1414

1515
# Use an existing model with Azure Machine Learning
@@ -64,12 +64,14 @@ For more information, see the [Model.register()](https://docs.microsoft.com/pyth
6464
az ml model register -p ./models -n sentiment -w myworkspace -g myresourcegroup
6565
```
6666

67+
> [!TIP]
68+
> You can also set add `tags` and `properties` dictionary objects to the registered model. These values can be used later to help identify a specific model. For example, the framework used, training parameters, etc.
69+
6770
For more information, see the [az ml model register](https://docs.microsoft.com/cli/azure/ext/azure-cli-ml/ml/model?view=azure-cli-latest#ext-azure-cli-ml-az-ml-model-register) reference.
6871

6972

7073
For more information on model registration in general, see [Manage, deploy, and monitor machine learning models](concept-model-management-and-deployment.md).
7174

72-
7375
## Define inference configuration
7476

7577
The inference configuration defines the environment used to run the deployed model. The inference configuration references the following entities, which are used to run the model when it's deployed:

0 commit comments

Comments
 (0)