Skip to content

Commit be8b7fc

Browse files
committed
PM feedback
1 parent 7815512 commit be8b7fc

File tree

2 files changed

+24
-29
lines changed

2 files changed

+24
-29
lines changed

articles/machine-learning/how-to-use-mlflow-cli-runs.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@ ms.subservice: mlops
1010
ms.reviewer: nibaccam
1111
ms.date: 12/16/2021
1212
ms.topic: how-to
13-
ms.custom: devx-track-python
13+
ms.custom: devx-track-python, mlflow
1414
---
1515

1616
# Track ML experiments and models with MLflow or the Azure Machine Learning CLI (v2) (preview)
1717

1818

19-
In this article, learn how to enable MLflow's tracking URI and logging API, collectively known as [MLflow Tracking](https://mlflow.org/docs/latest/quickstart.html#using-the-tracking-api), to connect Azure Machine Learning as the backend of your MLflow experiments. You can accomplish this connection with either the MLflow Python API or the [Azure Machine Learning CLI (v2)](how-to-train-cli.md). You also learn how to use [MLflow's Model Registry](https://mlflow.org/docs/latest/model-registry.html) capabilities with Azure Machine Learning.
19+
In this article, learn how to enable MLflow's tracking URI and logging API, collectively known as [MLflow Tracking](https://mlflow.org/docs/latest/quickstart.html#using-the-tracking-api), to connect Azure Machine Learning as the backend of your MLflow experiments. You can accomplish this connection with either the MLflow Python API or the [Azure Machine Learning CLI (v2) (preview)](how-to-train-cli.md) in your terminal. You also learn how to use [MLflow's Model Registry](https://mlflow.org/docs/latest/model-registry.html) capabilities with Azure Machine Learning.
2020

2121
[MLflow](https://www.mlflow.org) is an open-source library for managing the lifecycle of your machine learning experiments. MLflow Tracking is a component of MLflow that logs and tracks your training run metrics and model artifacts, no matter your experiment's environment--locally on your computer, on a remote compute target, a virtual machine, or an [Azure Databricks cluster](how-to-use-mlflow-azure-databricks.md).
2222

2323
See [MLflow and Azure Machine Learning](concept-mlflow.md) for all supported MLflow and Azure Machine Learning functionality including MLflow Project support (preview) and model deployment.
24-
2524

2625
> [!TIP]
2726
> The information in this document is primarily for data scientists and developers who want to monitor the model training process. If you are an administrator interested in monitoring resource usage and events from Azure Machine Learning, such as quotas, completed training runs, or completed model deployments, see [Monitoring Azure Machine Learning](monitor-azure-machine-learning.md).
@@ -31,6 +30,9 @@ See [MLflow and Azure Machine Learning](concept-mlflow.md) for all supported MLf
3130
3231
## Prerequisites
3332

33+
* Install the `azureml-mlflow` package.
34+
* This package automatically brings in `azureml-core` of the [The Azure Machine Learning Python SDK](/python/api/overview/azure/ml/install), which provides the connectivity for MLflow to access your workspace.
35+
3436
* [Create an Azure Machine Learning Workspace](how-to-manage-workspace.md).
3537
* See which [access permissions you need to perform your MLflow operations with your workspace](how-to-assign-roles.md#mlflow-operations).
3638

@@ -40,13 +42,13 @@ See [MLflow and Azure Machine Learning](concept-mlflow.md) for all supported MLf
4042

4143
## Track runs from your local machine
4244

43-
MLflow Tracking with Azure Machine Learning lets you store the logged metrics and artifacts runs that were executed on your local machine into your Azure Machine Learning workspace.
45+
MLflow Tracking with Azure Machine Learning lets you store the logged metrics and artifacts runs that were executed on your local machine into your Azure Machine Learning workspace. Make sure you are logged in to your Azure account, otherwise your the tracking URI returns an empty string.
4446

4547
### Set up tracking environment
4648

4749
To track a local run, you need to point your local machine to the Azure Machine Learning MLflow Tracking URI.
4850

49-
# [MLflow](#tab/mlflow)
51+
# [MLflow SDK](#tab/mlflow)
5052

5153
The following code uses `mlflow` and the [`subprocess`](https://docs.python.org/3/library/subprocess.html) classes in Python to run the Azure Machine Learning CLI (v2) command to retrieve the unique MLFLow tracking URI associated with your workspace. Then the method [`set_tracking_uri()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_tracking_uri) points the MLflow tracking URI to that URI.
5254

@@ -68,7 +70,7 @@ mlflow.set_tracking_uri(MLFLOW_TRACKING_URI)
6870
print("MLFlow Tracking URI:",MLFLOW_TRACKING_URI)
6971
```
7072

71-
# [Azure CLI (v2)](#tab/azure-cli)
73+
# [Terminal](#tab/terminal)
7274

7375
Another option is to set one of the MLflow environment variables [MLFLOW_TRACKING_URI](https://mlflow.org/docs/latest/tracking.html#logging-to-a-tracking-server) directly in your terminal.
7476

@@ -82,32 +84,25 @@ export MLFLOW_TRACKING_URI=$(az ml workspace show --query mlflow_tracking_uri |
8284

8385
### Set experiment name
8486

85-
All MLflow runs are logged to the active experiment, which can be set using MLflow or the Azure CLI.
87+
All MLflow runs are logged to the active experiment, which can be set using MLflow SDK or the Azure CLI.
8688

87-
# [MLflow](#tab/mlflow)
89+
# [MLflow SDK](#tab/mlflow)
8890

8991
With MLflow you can use the [`mlflow.set_experiment()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_experiment) command.
9092

91-
```Python
92-
experiment_name = 'experiment_with_mlflow'
93-
mlflow.set_experiment(experiment_name)
94-
```
95-
96-
Another option is to use the `experiment_id` parameter in the [mlflow.start_run()](https://www.mlflow.org/docs/latest/python_api/mlflow.html#mlflow.start_run) command.
93+
```Python
94+
experiment_name = 'experiment_with_mlflow'
95+
mlflow.set_experiment(experiment_name)
96+
```
9797

98-
```Python
99-
experiment_name = 'experiment_with_mlflow'
100-
with mlflow.start_run(experiment_id=experiment_name) as mlflow_run:
101-
mlflow.log_param("hello_param", "world")
102-
```
103-
# [Azure CLI (v2)](#tab/azure-cli)
98+
# [Terminal](#tab/terminal)
10499

105-
With the Azure CLI (v2), set one of the MLflow environment variables [MLFLOW_EXPERIMENT_NAME or MLFLOW_EXPERIMENT_ID](https://mlflow.org/docs/latest/cli.html#cmdoption-mlflow-run-arg-uri) with the experiment name.
100+
You can set one of the MLflow environment variables [MLFLOW_EXPERIMENT_NAME or MLFLOW_EXPERIMENT_ID](https://mlflow.org/docs/latest/cli.html#cmdoption-mlflow-run-arg-uri) with the experiment name.
106101

107-
```Azure CLI
108-
# Configure MLflow to communicate with a Azure Machine Learning-hosted tracking server
109-
export MLFLOW_EXPERIMENT_NAME="experiment_with_mlflow"
110-
```
102+
```Azure CLI
103+
# Configure MLflow to communicate with a Azure Machine Learning-hosted tracking server
104+
export MLFLOW_EXPERIMENT_NAME="experiment_with_mlflow"
105+
```
111106
---
112107

113108
### Start training run
@@ -221,8 +216,8 @@ client.download_artifacts(run_id, "helloworld.txt", ".")
221216

222217
### Compare and query
223218

224-
Compare and query all MLflow runs in your Azure Machine Learning Workspace with the following code.
225-
[Learn more about how to query runs with MLflow](how-to-train-cli.md#query-metrics-with-mlflow).
219+
Compare and query all MLflow runs in your Azure Machine Learning workspace with the following code.
220+
[Learn more about how to query runs with MLflow](https://mlflow.org/docs/latest/search-syntax.html#programmatically-searching-runs).
226221

227222
```Python
228223
from mlflow.entities import ViewType

articles/machine-learning/how-to-use-mlflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.subservice: mlops
1010
ms.reviewer: nibaccam
1111
ms.date: 10/21/2021
1212
ms.topic: how-to
13-
ms.custom: devx-track-python
13+
ms.custom: devx-track-python, mlflow
1414
---
1515

1616
# Track ML models with MLflow and Azure Machine Learning
@@ -25,7 +25,7 @@ Supported capabilities include:
2525

2626
+ Track and manage models in MLflow and Azure Machine Learning model registry.
2727

28-
[MLflow](https://www.mlflow.org) is an open-source library for managing the life cycle of your machine learning experiments. MLFlow Tracking is a component of MLflow that logs and tracks your training run metrics and model artifacts, no matter your experiment's environment--locally on your computer, on a remote compute target, a virtual machine, or an [Azure Databricks cluster](how-to-use-mlflow-azure-databricks.md).
28+
[MLflow](https://www.mlflow.org) is an open-source library for managing the life cycle of your machine learning experiments. MLflow Tracking is a component of MLflow that logs and tracks your training run metrics and model artifacts, no matter your experiment's environment--locally on your computer, on a remote compute target, a virtual machine, or an [Azure Databricks cluster](how-to-use-mlflow-azure-databricks.md).
2929

3030
See [MLflow and Azure Machine Learning](concept-mlflow.md) for additional MLflow and Azure Machine Learning functionality integrations.
3131

0 commit comments

Comments
 (0)