dev commit

This commit is contained in:
Tomasz Dłuski
2020-08-23 14:48:38 +02:00
parent 6526c3892f
commit 0f002cf097
6 changed files with 83 additions and 14 deletions

View File

@@ -1,20 +1,22 @@
import os
from random import random, randint
from mlflow import log_metric, log_param, log_artifacts
from mlflow import mlflow,log_metric, log_param, log_artifacts
if __name__ == "__main__":
print("Running mlflow_tracking.py")
with mlflow.start_run() as run:
mlflow.set_tracking_uri('http://localhost:5000')
print("Running mlflow_tracking.py")
log_param("param1", randint(0, 100))
log_metric("foo", random())
log_metric("foo", random() + 1)
log_metric("foo", random() + 2)
log_param("param1", randint(0, 100))
log_metric("foo", random())
log_metric("foo", random() + 1)
log_metric("foo", random() + 2)
if not os.path.exists("outputs"):
os.makedirs("outputs")
with open("outputs/test.txt", "w") as f:
f.write("hello world!")
if not os.path.exists("outputs"):
os.makedirs("outputs")
with open("outputs/test.txt", "w") as f:
f.write("hello world!")
log_artifacts("outputs")
log_artifacts("outputs")