Skip to content

Commit

Permalink
update notebook example
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanSoley committed May 1, 2024
1 parent b72c7b4 commit b39712d
Showing 1 changed file with 68 additions and 39 deletions.
107 changes: 68 additions & 39 deletions notebooks/logging-examples/tagging.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"`experiment_a` ID: 2e23d721-b58e-44b3-b53a-7889319425ea, tags: ['tag_a']\n",
"`experiment_b` ID: 1f573c46-8e82-4fa4-a560-6bd92778b882, tags: ['tag_b']\n",
"`experiment_c` ID: 85580996-fa26-49c4-b4ec-fb015c1f517c, tags: ['tag_a', 'tag_b']\n"
"`experiment_a` ID: 7e08c0bf-7f88-46d1-89de-4e0da7e2a448, tags: ['tag_a']\n",
"`experiment_b` ID: 75e54061-5910-43a0-a036-c5a6bdd77ca1, tags: ['other_tag_a', 'tag_b']\n",
"`experiment_c` ID: cc09ea5c-18df-48b1-888e-e692f5d9e71a, tags: ['tag_a', 'tag_b']\n"
]
}
],
"source": [
"experiment_a = project.log_experiment(tags=[\"tag_a\"])\n",
"experiment_b = project.log_experiment(tags=[\"tag_b\"])\n",
"experiment_b = project.log_experiment(tags=[\"other_tag_a\", \"tag_b\"])\n",
"experiment_c = project.log_experiment(tags=[\"tag_a\", \"tag_b\"])\n",
"\n",
"print(f\"`experiment_a` ID: {experiment_a.id}, tags: {experiment_a.tags}\")\n",
Expand Down Expand Up @@ -116,8 +116,8 @@
{
"data": {
"text/plain": [
"['2e23d721-b58e-44b3-b53a-7889319425ea',\n",
" '85580996-fa26-49c4-b4ec-fb015c1f517c']"
"[\"7e08c0bf-7f88-46d1-89de-4e0da7e2a448: ['tag_a']\",\n",
" \"cc09ea5c-18df-48b1-888e-e692f5d9e71a: ['tag_a', 'tag_b']\"]"
]
},
"execution_count": 4,
Expand All @@ -126,7 +126,7 @@
}
],
"source": [
"[e.id for e in project.experiments(tags=[\"tag_a\"])]"
"[f\"{e.id}: {e.tags}\" for e in project.experiments(tags=[\"tag_a\"])]"
]
},
{
Expand All @@ -147,8 +147,8 @@
{
"data": {
"text/plain": [
"['1f573c46-8e82-4fa4-a560-6bd92778b882',\n",
" '85580996-fa26-49c4-b4ec-fb015c1f517c']"
"[\"75e54061-5910-43a0-a036-c5a6bdd77ca1: ['other_tag_a', 'tag_b']\",\n",
" \"cc09ea5c-18df-48b1-888e-e692f5d9e71a: ['tag_a', 'tag_b']\"]"
]
},
"execution_count": 5,
Expand All @@ -157,7 +157,7 @@
}
],
"source": [
"[e.id for e in project.experiments(tags=[\"tag_b\"])]"
"[f\"{e.id}: {e.tags}\" for e in project.experiments(tags=[\"tag_b\"])]"
]
},
{
Expand All @@ -177,9 +177,9 @@
{
"data": {
"text/plain": [
"['2e23d721-b58e-44b3-b53a-7889319425ea',\n",
" '1f573c46-8e82-4fa4-a560-6bd92778b882',\n",
" '85580996-fa26-49c4-b4ec-fb015c1f517c']"
"[\"7e08c0bf-7f88-46d1-89de-4e0da7e2a448: ['tag_a']\",\n",
" \"75e54061-5910-43a0-a036-c5a6bdd77ca1: ['other_tag_a', 'tag_b']\",\n",
" \"cc09ea5c-18df-48b1-888e-e692f5d9e71a: ['tag_a', 'tag_b']\"]"
]
},
"execution_count": 6,
Expand All @@ -188,7 +188,7 @@
}
],
"source": [
"[e.id for e in project.experiments(tags=[\"tag_a\", \"tag_b\"])]"
"[f\"{e.id}: {e.tags}\" for e in project.experiments(tags=[\"tag_a\", \"tag_b\"])]"
]
},
{
Expand All @@ -208,7 +208,7 @@
{
"data": {
"text/plain": [
"['85580996-fa26-49c4-b4ec-fb015c1f517c']"
"[\"cc09ea5c-18df-48b1-888e-e692f5d9e71a: ['tag_a', 'tag_b']\"]"
]
},
"execution_count": 7,
Expand All @@ -217,7 +217,7 @@
}
],
"source": [
"[e.id for e in project.experiments(tags=[\"tag_a\", \"tag_b\"], qtype=\"and\")]"
"[f\"{e.id}: {e.tags}\" for e in project.experiments(tags=[\"tag_a\", \"tag_b\"], qtype=\"and\")]"
]
},
{
Expand All @@ -239,8 +239,9 @@
{
"data": {
"text/plain": [
"[\"2e23d721-b58e-44b3-b53a-7889319425ea: ['tag_a']\",\n",
" \"85580996-fa26-49c4-b4ec-fb015c1f517c: ['tag_a', 'tag_b']\"]"
"[\"7e08c0bf-7f88-46d1-89de-4e0da7e2a448: ['tag_a']\",\n",
" \"75e54061-5910-43a0-a036-c5a6bdd77ca1: ['other_tag_a', 'tag_b']\",\n",
" \"cc09ea5c-18df-48b1-888e-e692f5d9e71a: ['tag_a', 'tag_b']\"]"
]
},
"execution_count": 8,
Expand Down Expand Up @@ -270,9 +271,7 @@
{
"data": {
"text/plain": [
"[\"2e23d721-b58e-44b3-b53a-7889319425ea: ['tag_a']\",\n",
" \"1f573c46-8e82-4fa4-a560-6bd92778b882: ['tag_b']\",\n",
" \"85580996-fa26-49c4-b4ec-fb015c1f517c: ['tag_a', 'tag_b']\"]"
"[\"75e54061-5910-43a0-a036-c5a6bdd77ca1: ['other_tag_a', 'tag_b']\"]"
]
},
"execution_count": 9,
Expand All @@ -281,7 +280,7 @@
}
],
"source": [
"[f\"{e.id}: {e.tags}\" for e in project.experiments(tags=[\"*_*\"])]"
"[f\"{e.id}: {e.tags}\" for e in project.experiments(tags=[\"*_*_*\"])]"
]
},
{
Expand Down Expand Up @@ -333,7 +332,7 @@
{
"data": {
"text/plain": [
"['tag_i', 'tag_h', 'tag_a', 'tag_b']"
"['tag_i', 'tag_h', 'tag_b', 'tag_a']"
]
},
"execution_count": 11,
Expand Down Expand Up @@ -402,7 +401,7 @@
}
],
"source": [
"[e.id for e in project.experiments(tags=[\"tag_a\", \"tag_b\"], qtype=\"and\")]"
"[f\"{e.id}: {e.tags}\" for e in project.experiments(tags=[\"tag_a\", \"tag_b\"], qtype=\"and\")]"
]
},
{
Expand All @@ -423,7 +422,7 @@
"outputs": [],
"source": [
"experiment_d = project.log_experiment(tags=[\"tag_j:k\"])\n",
"experiment_e = project.log_experiment(tags=[\"tag_l:m\", \"tag_l:n\"])"
"experiment_e = project.log_experiment(tags=[\"tag_j:l\", \"tag_m:n\", \"tag_m:o\"])"
]
},
{
Expand Down Expand Up @@ -503,7 +502,7 @@
{
"data": {
"text/plain": [
"['m', 'n']"
"['n', 'o']"
]
},
"execution_count": 17,
Expand All @@ -512,7 +511,37 @@
}
],
"source": [
"experiment_e.tags[\"tag_l\"]"
"experiment_e.tags[\"tag_m\"]"
]
},
{
"cell_type": "markdown",
"id": "a85a3307-eb62-4bd1-b0eb-9367f6edf164",
"metadata": {},
"source": [
"Combine key-value tags and wildcards to examine the value of _\"tag_j\"_ on every experiment that has one."
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "334e5096-b816-4981-b6c2-6e741a323a3e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['0962a69f-1db5-4f42-884c-60ad179bdb5c: k',\n",
" 'd5c9d775-e546-4b02-93ac-f5cee6d17aea: l']"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"[f\"{e.id}: {e.tags['tag_j']}\" for e in project.experiments(tags=[\"tag_j:*\"])]"
]
},
{
Expand All @@ -528,19 +557,19 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 19,
"id": "ab2c5a29-b8ee-45e7-b4b9-6dc22c3abdd7",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['child:a0260c5a-a0e5-4a90-8667-514795a9c329',\n",
" 'child:8dc5ecb3-368f-42ea-b444-b49d997045a3',\n",
"['child:0962a69f-1db5-4f42-884c-60ad179bdb5c',\n",
" 'child:d5c9d775-e546-4b02-93ac-f5cee6d17aea',\n",
" 'tag_a']"
]
},
"execution_count": 18,
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -564,18 +593,18 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 20,
"id": "b3c04d92-6f52-4c19-ab0e-6907b4f8ab17",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['a0260c5a-a0e5-4a90-8667-514795a9c329',\n",
" '8dc5ecb3-368f-42ea-b444-b49d997045a3']"
"['0962a69f-1db5-4f42-884c-60ad179bdb5c',\n",
" 'd5c9d775-e546-4b02-93ac-f5cee6d17aea']"
]
},
"execution_count": 19,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -594,18 +623,18 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 21,
"id": "876a3358-2277-47b4-910f-1a1db89bda9d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<rubicon_ml.client.experiment.Experiment at 0x11927c130>,\n",
" <rubicon_ml.client.experiment.Experiment at 0x11927c430>]"
"[<rubicon_ml.client.experiment.Experiment at 0x163cad2a0>,\n",
" <rubicon_ml.client.experiment.Experiment at 0x163cad030>]"
]
},
"execution_count": 20,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
Expand Down

0 comments on commit b39712d

Please sign in to comment.