Skip to content

Instantly share code, notes, and snippets.

@azarnyx
Created June 30, 2019 12:07
Show Gist options
  • Save azarnyx/c31ed398a9677b440e5013147f5db221 to your computer and use it in GitHub Desktop.
Save azarnyx/c31ed398a9677b440e5013147f5db221 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"! pip install mlflow"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import mlflow\n",
"\n",
"\n",
"mlflow.set_tracking_uri(sql_string)\n",
"expname = \"test MLflow\"\n",
"mlflow.create_experiment(expname, artifact_location=\"gs://MLflowartifacts/\")\n",
"\n",
"with open(\"artifact.txt\", \"w\") as f:\n",
" f.write(\"Hello world!\")\n",
"with mlflow.start_run():\n",
" for i in range(10):\n",
" mlflow.log_metric(key=\"Loss Function\", value=i**2, step=i)\n",
" mlflow.log_artifact(\"artifact.txt\")"
]
}
],
"metadata": {
"colab": {
"collapsed_sections": [],
"name": "Colab_MLflow_test.ipynb",
"provenance": [],
"version": "0.3.2"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment