-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch_mlflow_runs.py
More file actions
54 lines (45 loc) · 1.4 KB
/
search_mlflow_runs.py
File metadata and controls
54 lines (45 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import mlflow
EXPERIMENT_NAME = "fashionmnist-pytorch-demo"
def main():
# Optional if using a local tracking server:
mlflow.set_tracking_uri("http://localhost:5000")
print("\nAll runs in experiment:")
runs_df = mlflow.search_runs(
experiment_names=[EXPERIMENT_NAME],
order_by=["metrics.best_val_accuracy DESC"],
)
print(runs_df[[
"run_id",
"tags.mlflow.runName",
"tags.group_name",
"tags.model_name",
"params.learning_rate",
"params.batch_size",
"metrics.best_val_accuracy",
"metrics.val_accuracy",
]])
print("\nOnly model_comparison runs:")
model_cmp_df = mlflow.search_runs(
experiment_names=[EXPERIMENT_NAME],
filter_string='tags.group_name = "model_comparison"',
order_by=["metrics.best_val_accuracy DESC"],
)
print(model_cmp_df[[
"run_id",
"tags.mlflow.runName",
"tags.model_name",
"metrics.best_val_accuracy",
]])
print("\nOnly CNN runs with strong accuracy:")
cnn_df = mlflow.search_runs(
experiment_names=[EXPERIMENT_NAME],
filter_string='tags.model_name = "cnn" AND metrics.best_val_accuracy > 0.85',
order_by=["metrics.best_val_accuracy DESC"],
)
print(cnn_df[[
"run_id",
"tags.mlflow.runName",
"metrics.best_val_accuracy",
]])
if __name__ == "__main__":
main()