Skip to content

Instantly share code, notes, and snippets.

@jackersson
Last active November 27, 2019 16:54
Show Gist options
  • Save jackersson/a17bc8c229c1d57d0e3806c3aa86620d to your computer and use it in GitHub Desktop.
Save jackersson/a17bc8c229c1d57d0e3806c3aa86620d to your computer and use it in GitHub Desktop.
MLFlow
import mlflow # import log_metric, log_param, log_artifact
# https://www.youtube.com/watch?v=wb-ZxtIwSTA
def exp(metric, param):
mlflow.set_tracking_uri("http://mlflow:NJKbe21jk4e1@ec2-18-184-150-238.eu-central-1.compute.amazonaws.com/")
exp_name = "smart-counter"
mlflow.set_experiment(exp_name)
with mlflow.start_run(nested=True):
mlflow.log_param("param1", param)
mlflow.set_tag("release", "v0.0.1")
with open("info.txt", "w") as f:
f.write("Hi artifact")
mlflow.log_artifact("info.txt")
mlflow.log_metric(key="counter", value=metric)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment