Skip to content

Commit 63ddc12

Browse files
Merge pull request #242960 from santiagxf/santiagxf/mlflow-tracking
Update how-to-track-experiments-mlflow.md
2 parents 96ceec4 + dfd59dd commit 63ddc12

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

articles/machine-learning/how-to-track-experiments-mlflow.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,28 +135,38 @@ All metrics and parameters are also returned when querying runs. However, for me
135135

136136
By default, experiments are ordered descending by `start_time`, which is the time the experiment was queue in Azure Machine Learning. However, you can change this default by using the parameter `order_by`.
137137

138-
* Order runs by the attribute `start_time`:
138+
* Order runs by attributes, like `start_time`:
139139

140140
```python
141141
mlflow.search_runs(experiment_ids=[ "1234-5678-90AB-CDEFG" ],
142142
order_by=["attributes.start_time DESC"])
143143
```
144144

145-
* Order and retrieve the last run:
145+
* Order runs and limit results. The following example returns the last single run in the experiment:
146146

147147
```python
148148
mlflow.search_runs(experiment_ids=[ "1234-5678-90AB-CDEFG" ],
149149
max_results=1, order_by=["attributes.start_time DESC"])
150150
```
151151

152+
* Order runs by the attribute `duration`:
153+
154+
```python
155+
mlflow.search_runs(experiment_ids=[ "1234-5678-90AB-CDEFG" ],
156+
order_by=["attributes.duration DESC"])
157+
```
158+
159+
> [!TIP]
160+
> `attributes.duration` is not present in MLflow OSS, but provided in Azure Machine Learning for convenience.
161+
152162
* Order runs by metric's values:
153163

154164
```python
155165
mlflow.search_runs(experiment_ids=[ "1234-5678-90AB-CDEFG" ]).sort_values("metrics.accuracy", ascending=False)
156166
```
157167

158168
> [!WARNING]
159-
> Using `order_by` with expressions containing `metrics.*` in the parameter `order_by` is not supported by the moment. Please use `order_values` method from Pandas as shown in the next example.
169+
> Using `order_by` with expressions containing `metrics.*`, `params.*`, or `tags.*` in the parameter `order_by` is not supported by the moment. Please use `order_values` method from Pandas as shown in the example.
160170

161171

162172
### Filtering runs
@@ -213,7 +223,18 @@ You can also look for a run with a specific combination in the hyperparameters u
213223

214224
> [!TIP]
215225
> Notice that for the key `attributes`, values should always be strings and hence encoded between quotes.
216-
226+
227+
* Search runs taking longer than one hour:
228+
229+
```python
230+
duration = 360 * 1000 # duration is in milliseconds
231+
mlflow.search_runs(experiment_ids=[ "1234-5678-90AB-CDEFG" ],
232+
filter_string=f"attributes.duration > '{duration}'")
233+
```
234+
235+
> [!TIP]
236+
> `attributes.duration` is not present in MLflow OSS, but provided in Azure Machine Learning for convenience.
237+
217238
* Search runs having the ID in a given set:
218239

219240
```python

0 commit comments

Comments
 (0)