You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-use-mlflow-cli-runs.md
+22-27Lines changed: 22 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,17 @@ ms.subservice: mlops
10
10
ms.reviewer: nibaccam
11
11
ms.date: 12/16/2021
12
12
ms.topic: how-to
13
-
ms.custom: devx-track-python
13
+
ms.custom: devx-track-python, mlflow
14
14
---
15
15
16
16
# Track ML experiments and models with MLflow or the Azure Machine Learning CLI (v2) (preview)
17
17
18
18
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.
20
20
21
21
[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).
22
22
23
23
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
-
25
24
26
25
> [!TIP]
27
26
> 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
31
30
32
31
## Prerequisites
33
32
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
+
34
36
*[Create an Azure Machine Learning Workspace](how-to-manage-workspace.md).
35
37
* See which [access permissions you need to perform your MLflow operations with your workspace](how-to-assign-roles.md#mlflow-operations).
36
38
@@ -40,13 +42,13 @@ See [MLflow and Azure Machine Learning](concept-mlflow.md) for all supported MLf
40
42
41
43
## Track runs from your local machine
42
44
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.
44
46
45
47
### Set up tracking environment
46
48
47
49
To track a local run, you need to point your local machine to the Azure Machine Learning MLflow Tracking URI.
48
50
49
-
# [MLflow](#tab/mlflow)
51
+
# [MLflow SDK](#tab/mlflow)
50
52
51
53
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.
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.
74
76
@@ -82,32 +84,25 @@ export MLFLOW_TRACKING_URI=$(az ml workspace show --query mlflow_tracking_uri |
82
84
83
85
### Set experiment name
84
86
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.
86
88
87
-
# [MLflow](#tab/mlflow)
89
+
# [MLflow SDK](#tab/mlflow)
88
90
89
91
With MLflow you can use the [`mlflow.set_experiment()`](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.set_experiment) command.
90
92
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
+
```
97
97
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)
104
99
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.
106
101
107
-
```Azure CLI
108
-
# Configure MLflow to communicate with a Azure Machine Learning-hosted tracking server
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-use-mlflow.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.subservice: mlops
10
10
ms.reviewer: nibaccam
11
11
ms.date: 10/21/2021
12
12
ms.topic: how-to
13
-
ms.custom: devx-track-python
13
+
ms.custom: devx-track-python, mlflow
14
14
---
15
15
16
16
# Track ML models with MLflow and Azure Machine Learning
@@ -25,7 +25,7 @@ Supported capabilities include:
25
25
26
26
+ Track and manage models in MLflow and Azure Machine Learning model registry.
27
27
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).
29
29
30
30
See [MLflow and Azure Machine Learning](concept-mlflow.md) for additional MLflow and Azure Machine Learning functionality integrations.
0 commit comments