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
#Customer intent: As a data scientist, I want to know how to track my machine learning experiments and models with MLflow so I can use MLflow for tracking.
14
+
#Customer intent: As a data scientist, I want to know how to track my machine learning experiments and models with MLflow so I can use MLflow for tracking in Azure Machine Learning.
15
15
---
16
16
17
17
# Track experiments and models with MLflow
18
18
19
-
In this article, you learn how to use MLflow for tracking experiments and runs in Azure Machine Learning workspaces. *Tracking* is the process of saving relevant information about experiments. The saved metadata varies by experiment, and can include:
19
+
*Tracking* is the process of saving relevant information about experiments. In this article, you learn how to use MLflow for tracking experiments and runs in Azure Machine Learning workspaces. The saved metadata varies by experiment, and can include:
20
20
21
21
- Code
22
22
- Environment details such as OS version and Python packages
@@ -29,7 +29,7 @@ In this article, you learn how to use MLflow for tracking experiments and runs i
29
29
30
30
When you work with jobs, Azure Machine Learning automatically tracks some information about experiments, such as code, environment, and input and output data. However, models, parameters, and metrics are specific to the scenario, so model builders must configure their tracking.
31
31
32
-
Whether you train with jobs in Azure Machine Learning or interactively in notebooks, experiment tracking helps you:
32
+
Whether you train models with jobs in Azure Machine Learning or interactively in notebooks, experiment tracking helps you:
33
33
34
34
- Organize all of your machine learning experiments in a single place. You can then search and filter experiments and drill down to see details about previous experiments.
35
35
- Easily compare experiments, analyze results, and debug model training.
@@ -40,7 +40,7 @@ Whether you train with jobs in Azure Machine Learning or interactively in notebo
40
40
> - To track experiments running on Azure Databricks, see [Track Azure Databricks ML experiments with MLflow and Azure Machine Learning](how-to-use-mlflow-azure-databricks.md).
41
41
> - To track experiments running on Azure Synapse Analytics, see [Track Azure Synapse Analytics ML experiments with MLflow and Azure Machine Learning](how-to-use-mlflow-azure-synapse.md).
42
42
43
-
Azure Machine Learning workspaces are MLflow-compatible. This compatibility means you can use MLflow to track runs, metrics, parameters, and artifacts in the workspaces without needing to change your training routines or inject any cloud-specific syntax. For more information about supported MLflow and Azure Machine Learning functionalities, see [MLflow and Azure Machine Learning](concept-mlflow.md).
43
+
Azure Machine Learning workspaces are MLflow-compatible. This compatibility means you can use MLflow to track runs, metrics, parameters, and artifacts in workspaces without needing to change your training routines or inject any cloud-specific syntax. For more information about supported MLflow and Azure Machine Learning functionalities, see [MLflow and Azure Machine Learning](concept-mlflow.md).
44
44
45
45
>[!NOTE]
46
46
>Some methods available in the MLflow API might not be available when connected to Azure Machine Learning. For details about supported and unsupported operations, see [Support matrix for querying runs and experiments](how-to-track-experiments-mlflow.md#support-matrix-for-querying-runs-and-experiments).
@@ -53,7 +53,7 @@ Azure Machine Learning workspaces are MLflow-compatible. This compatibility mean
53
53
54
54
## Configure the experiment
55
55
56
-
MLflow organizes information in experiments and runs. Runs are called *jobs* in Azure Machine Learning. By default, runs are logged to an experiment named **Default** that's automatically created for you. You can configure the experiment to track.
56
+
MLflow organizes information in experiments and runs, which are called *jobs* in Azure Machine Learning. By default, runs log to an automatically created experiment named **Default**, but youcan configure which experiment to track.
57
57
58
58
# [Notebooks](#tab/interactive)
59
59
@@ -74,11 +74,11 @@ To submit jobs by using the Azure Machine Learning CLI or SDK, set the experimen
74
74
75
75
## Configure the run
76
76
77
-
Azure Machine Learning tracks any training job in what MLflow calls a run. Use runs to capture all the processing that your job performs.
77
+
Azure Machine Learning tracks training jobs in what MLflow calls runs. Use runs to capture all the processing that your job performs.
78
78
79
79
# [Notebooks](#tab/interactive)
80
80
81
-
When you work interactively, MLflow starts tracking your training routine as soon as you try to log information that requires an active run. For instance, if Mlflow's autologging functionality is enabled, MLflow tracking starts when you log a metric or parameter, or start a training cycle.
81
+
When you work interactively, MLflow starts tracking your training routine as soon as you start to log information that requires an active run. For instance, if Mlflow's autologging functionality is enabled, MLflow tracking starts when you log a metric or parameter, or start a training cycle.
82
82
83
83
However, it's usually helpful to start the run explicitly, especially if you want to capture the total time for your experiment in the **Duration** field. To start the run explicitly, use `mlflow.start_run()`.
84
84
@@ -112,31 +112,29 @@ with mlflow.start_run(run_name="hello-world-example") as run:
112
112
113
113
Azure Machine Learning jobs allow you to submit long-running training or inference routines as isolated and reproducible executions.
114
114
115
-
### Create a training routine
115
+
### Create a training routine that has tracking
116
116
117
-
When you work with jobs, you typically place all your training logic as files inside a folder, such as *src*. One of the files is a Python file with your training code entry point. The following example shows a *hello_world.py* example:
117
+
When you work with jobs, you typically place all your training logic as files inside a folder, such as *src*. One of the files is a Python file with your training code entry point.
In your training routine, you can use the MLflow SDK to track any metric, parameter, artifacts, or models. For examples, see [Log metrics, parameters, and files with MLflow](how-to-log-view-metrics.md).
120
120
121
-
The previous code example doesn't use `mlflow.start_run()` but if used, MLflow reuses the current active run. Therefore, you don't need to remove the `mlflow.start_run()` line if you migrate code to Azure Machine Learning.
121
+
The following example shows a *hello_world.py* training routine that adds logging:
Use the MLflow SDK to track any metric, parameter, artifacts, or models. For examples, see [Log metrics, parameters, and files with MLflow](how-to-log-view-metrics.md).
125
+
The previous code example doesn't use `mlflow.start_run()` but if used, MLflow reuses the current active run. Therefore, you don't need to remove the `mlflow.start_run()` line if you migrate code to Azure Machine Learning.
126
126
127
127
### Ensure your job's environment has MLflow installed
128
128
129
-
All Azure Machine Learning curated environments already have MLflow installed. However, if you use a custom environment, create a *conda.yaml* file that has the dependencies you need, as follows:
129
+
All Azure Machine Learning curated environments already have MLflow installed. However, if you use a custom environment, create a *conda.yaml* file that has the dependencies you need, and reference the environment in your job.
Use the Azure Machine Learning jobs parameter `display_name` to configure the name of the run. Make sure not to use `mlflow.start_run(run_name="")` inside your training routine.
138
-
139
-
1. Use the `display_name` property to configure the job.
137
+
Use the Azure Machine Learning jobs parameter `display_name` to configure the name of the job. Make sure not to use `mlflow.start_run(run_name="")` inside your training routine.
140
138
141
139
# [Azure CLI](#tab/cli)
142
140
@@ -162,12 +160,14 @@ Use the Azure Machine Learning jobs parameter `display_name` to configure the na
162
160
163
161
### Submit the job
164
162
165
-
The workspace is the top-level resource for Azure Machine Learning, providing a centralized place to work with the artifacts you create. Jobs that use MLflow and run on Azure Machine Learning automatically log any tracking information to the workspace. In this section, you connect to the workspace and do deployment tasks.
163
+
The workspace is the top-level resource for Azure Machine Learning, providing a centralized place to work with the artifacts you create. Jobs that use MLflow and run on Azure Machine Learning automatically log any tracking information to the workspace. In this section, you connect to the workspace to do deployment tasks.
166
164
167
165
1. Connect to your Azure Machine Learning workspace.
168
166
169
167
# [Azure CLI](#tab/cli)
170
168
169
+
Open your terminal and enter the following code:
170
+
171
171
```azurecli
172
172
az account set --subscription <subscription>
173
173
az configure --defaults workspace=<workspace> group=<resource-group> location=<location>
@@ -198,7 +198,7 @@ The workspace is the top-level resource for Azure Machine Learning, providing a
198
198
199
199
# [Azure CLI](#tab/cli)
200
200
201
-
Use the Azure Machine Learning CLI to [submit your job](how-to-train-model.md). Open your terminal and enter the following code:
201
+
Use the Azure Machine Learning CLI to [submit your job](how-to-train-model.md).
202
202
203
203
```azurecli
204
204
az ml job create -f job.yml --web
@@ -234,10 +234,11 @@ The metrics and artifacts from MLflow logging are tracked in your workspace. You
234
234
To view metrics and artifacts in the studio:
235
235
236
236
1. On the **Jobs** page in your workspace, find the experiment by name.
237
+
1. On the experiment details page, select the **Metrics** tab.
237
238
1. Select logged metrics to render charts on the right side. You can customize the charts by applying smoothing, changing the color, or plotting multiple metrics on a single graph. You can also resize and rearrange the layout.
238
239
1. Once you create your desired view, save it for future use and share it with your teammates by using a direct link.
239
240
240
-
:::image type="content" source="media/how-to-log-view-metrics/metrics.png" alt-text="Screenshot of the metrics view." lightbox="media/how-to-log-view-metrics/metrics.png":::
241
+
:::image type="content" source="media/how-to-log-view-metrics/metrics.png" alt-text="Screenshot of the metrics view that shows the list of metrics and the charts created from the metrics." lightbox="media/how-to-log-view-metrics/metrics.png":::
241
242
242
243
To access or query metrics, parameters, and artifacts programatically via the MLflow SDK, use [mlflow.get_run()](https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.get_run).
Copy file name to clipboardExpand all lines: articles/machine-learning/includes/machine-learning-mlflow-prereqs.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,4 +17,4 @@ ms.author: fasantia
17
17
18
18
- Create an Azure Machine Learning workspace. To create a workspace, see [Create resources you need to get started](../quickstart-create-resources.md). Review the [access permissions](../how-to-assign-roles.md#mlflow-operations) you need to perform your MLflow operations in your workspace.
19
19
20
-
- To do remote tracking, that is track experiments running outside Azure Machine Learning, configure MLflow to point to the tracking URI of your Azure Machine Learning workspace. For more information on how to connect MLflow to your workspace, see [Configure MLflow for Azure Machine Learning](../how-to-use-mlflow-configure-tracking.md).
20
+
- To do *remote tracking*, or track experiments running outside Azure Machine Learning, configure MLflow to point to the tracking URI of your Azure Machine Learning workspace. For more information on how to connect MLflow to your workspace, see [Configure MLflow for Azure Machine Learning](../how-to-use-mlflow-configure-tracking.md).
0 commit comments