Last active
December 5, 2019 03:15
-
-
Save tbenst/e793704190322915e9641c64351322a2 to your computer and use it in GitHub Desktop.
mlflow example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from mlflow import log_metric, log_param, log_artifact | |
import mlflow | |
mlflow.set_tracking_uri("http://localhost:5000") | |
mlflow.set_experiment("my-experiment") | |
if __name__ == "__main__": | |
# Log a parameter (key-value pair) | |
log_param("param1", 5) | |
# Log a metric; metrics can be updated throughout the run | |
log_metric("foo", 1) | |
log_metric("foo", 2) | |
log_metric("foo", 3) | |
# Log an artifact (output file) | |
with open("output.txt", "w") as f: | |
f.write("Hello world!") | |
log_artifact("output.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
mlflow server > log 2>&1 & | |
sleep 5 | |
python mlflow_tracking.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment