From 68d328a1d8c62c1f4d9a495abe4059657419075a Mon Sep 17 00:00:00 2001 From: katarinasupe Date: Thu, 4 May 2023 11:55:26 +0200 Subject: [PATCH] update workshop --- dors-cluc-workshop/game-of-graphs.ipynb | 142 +++++++++++++++--------- 1 file changed, 89 insertions(+), 53 deletions(-) diff --git a/dors-cluc-workshop/game-of-graphs.ipynb b/dors-cluc-workshop/game-of-graphs.ipynb index 1d45dad..785d89d 100644 --- a/dors-cluc-workshop/game-of-graphs.ipynb +++ b/dors-cluc-workshop/game-of-graphs.ipynb @@ -542,7 +542,7 @@ }, { "cell_type": "markdown", - "id": "09ef48dd", + "id": "f5e5e178", "metadata": {}, "source": [ "\"movies_graph_model\"" @@ -802,7 +802,7 @@ }, { "cell_type": "markdown", - "id": "e8138588", + "id": "6f5d65bd", "metadata": {}, "source": [ "\"movies_graph_model\"" @@ -896,7 +896,7 @@ }, { "cell_type": "markdown", - "id": "9ebc30c9", + "id": "9268df11", "metadata": {}, "source": [ "\"movies_graph_model\"" @@ -1087,7 +1087,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 48, "id": "d1834484", "metadata": { "scrolled": true @@ -1134,7 +1134,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 49, "id": "6a9afb9b", "metadata": {}, "outputs": [ @@ -1190,9 +1190,11 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 50, "id": "32535947", - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [ { "name": "stdout", @@ -1222,6 +1224,14 @@ " print(result[\"season\"].number, result[\"death_count\"])" ] }, + { + "cell_type": "markdown", + "id": "28594cdd", + "metadata": {}, + "source": [ + "\"movies_graph_model\"" + ] + }, { "cell_type": "markdown", "id": "eee3fc0c", @@ -1232,7 +1242,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 51, "id": "55679941", "metadata": {}, "outputs": [ @@ -1264,6 +1274,14 @@ " print(\"Season:\", result[\"season\"].number, \"| Rating:\", result[\"rating\"])" ] }, + { + "cell_type": "markdown", + "id": "1a589297", + "metadata": {}, + "source": [ + "\"movies_graph_model\"" + ] + }, { "cell_type": "markdown", "id": "65d019f1", @@ -1274,9 +1292,11 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 52, "id": "329bd44a", - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [ { "name": "stdout", @@ -1315,6 +1335,14 @@ " \"| Deaths:\", result[\"deaths\"], \"| KDR:\", result[\"KDR\"])" ] }, + { + "cell_type": "markdown", + "id": "ab64cdfe", + "metadata": {}, + "source": [ + "\"movies_graph_model\"" + ] + }, { "cell_type": "markdown", "id": "371a847a", @@ -1325,7 +1353,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 56, "id": "52cef37b", "metadata": {}, "outputs": [ @@ -1371,7 +1399,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 57, "id": "c82986be", "metadata": {}, "outputs": [ @@ -1379,30 +1407,30 @@ "name": "stdout", "output_type": "stream", "text": [ - "Victim: Golden Company soldier | Kill Count: 374 | Episode name: The Bells \n", - "Victim: Kings Landing Citizen | Kill Count: 227 | Episode name: The Bells \n", - "Victim: Lannister soldier | Kill Count: 178 | Episode name: The Spoils of War \n", - "Victim: Lannister soldier | Kill Count: 166 | Episode name: The Bells \n", + "Victim: Golden Company soldier | Kill Count: 374 | Episode name: The Bells\n", + "Victim: Kings Landing Citizen | Kill Count: 227 | Episode name: The Bells\n", + "Victim: Lannister soldier | Kill Count: 178 | Episode name: The Spoils of War\n", + "Victim: Lannister soldier | Kill Count: 166 | Episode name: The Bells\n", "Victim: Sons of the Harpy agent | Kill Count: 54 | Episode name: The Dance of Dragons\n", - "Victim: Dothraki Khal | Kill Count: 14 | Episode name: Book of the Stranger \n", + "Victim: Dothraki Khal | Kill Count: 14 | Episode name: Book of the Stranger\n", "Victim: The Masters Soldier | Kill Count: 12 | Episode name: Battle of the Bastards\n", - "Victim: Greyjoy Soldier | Kill Count: 2 | Episode name: The Bells \n", - "Victim: Horse | Kill Count: 2 | Episode name: The Spoils of War \n", - "Victim: Xaro Xhoan Daxos | Kill Count: 1 | Episode name: Valar Morghulis \n", - "Victim: Khal Moro | Kill Count: 1 | Episode name: Book of the Stranger \n", - "Victim: Golden Company horse | Kill Count: 1 | Episode name: The Bells \n", - "Victim: Pyat Pree | Kill Count: 1 | Episode name: Valar Morghulis \n", - "Victim: Zalla | Kill Count: 1 | Episode name: The Children \n", - "Victim: Kraznys mo Nakloz | Kill Count: 1 | Episode name: And Now His Watch Is Ended \n", - "Victim: Varys | Kill Count: 1 | Episode name: The Bells \n", - "Victim: Doreah | Kill Count: 1 | Episode name: Valar Morghulis \n", - "Victim: Cersei Lannister | Kill Count: 1 | Episode name: The Bells \n", - "Victim: Goat | Kill Count: 1 | Episode name: The Laws of Gods and Men \n", - "Victim: Mirri Maz Duur | Kill Count: 1 | Episode name: Fire and Blood\n", - "Victim: Khal Drogo | Kill Count: 1 | Episode name: Fire and Blood\n", + "Victim: Horse | Kill Count: 2 | Episode name: The Spoils of War\n", + "Victim: Greyjoy Soldier | Kill Count: 2 | Episode name: The Bells\n", + "Victim: Pyat Pree | Kill Count: 1 | Episode name: Valar Morghulis\n", "Victim: Dickon Tarly | Kill Count: 1 | Episode name: Eastwatch\n", + "Victim: Xaro Xhoan Daxos | Kill Count: 1 | Episode name: Valar Morghulis\n", + "Victim: Goat | Kill Count: 1 | Episode name: The Laws of Gods and Men\n", + "Victim: Varys | Kill Count: 1 | Episode name: The Bells\n", + "Victim: Mirri Maz Duur | Kill Count: 1 | Episode name: Fire and Blood\n", + "Victim: Kraznys mo Nakloz | Kill Count: 1 | Episode name: And Now His Watch Is Ended\n", + "Victim: Zalla | Kill Count: 1 | Episode name: The Children\n", + "Victim: Khal Moro | Kill Count: 1 | Episode name: Book of the Stranger\n", "Victim: Randyll Tarly | Kill Count: 1 | Episode name: Eastwatch\n", - "Victim: Jaime Lannister | Kill Count: 1 | Episode name: The Bells \n" + "Victim: Khal Drogo | Kill Count: 1 | Episode name: Fire and Blood\n", + "Victim: Golden Company horse | Kill Count: 1 | Episode name: The Bells\n", + "Victim: Doreah | Kill Count: 1 | Episode name: Valar Morghulis\n", + "Victim: Cersei Lannister | Kill Count: 1 | Episode name: The Bells\n", + "Victim: Jaime Lannister | Kill Count: 1 | Episode name: The Bells\n" ] } ], @@ -1422,6 +1450,14 @@ " , \"| Episode name:\", result[\"episode\"].name)" ] }, + { + "cell_type": "markdown", + "id": "cb417616", + "metadata": {}, + "source": [ + "\"movies_graph_model\"" + ] + }, { "cell_type": "markdown", "id": "5a38cecf", @@ -1432,7 +1468,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 58, "id": "94c66c50", "metadata": {}, "outputs": [ @@ -1440,16 +1476,16 @@ "name": "stdout", "output_type": "stream", "text": [ - "Daenerys Targaryen | BC: 0.26416716859707734\n", - "Lannister soldier | BC: 0.11163138590238253\n", - "Sons of the Harpy agent | BC: 0.04326120746568793\n", - "Jon Snow | BC: 0.04152733973021257\n", - "Wildling | BC: 0.037823960457165504\n", + "Daenerys Targaryen | BC: 0.2641671685970775\n", + "Lannister soldier | BC: 0.11163138590238258\n", + "Sons of the Harpy agent | BC: 0.043261207465688005\n", + "Jon Snow | BC: 0.04152733973021262\n", + "Wildling | BC: 0.03782396045716538\n", "Stark Soldier | BC: 0.02860945609559936\n", - "Baratheon of Dragonstone soldier | BC: 0.027533816622595367\n", + "Baratheon of Dragonstone soldier | BC: 0.02753381662259537\n", "Cersei Lannister | BC: 0.026445092829209968\n", - "Stark soldier | BC: 0.02432818459201446\n", - "Nights Watch brother | BC: 0.02271917772956741\n" + "Stark soldier | BC: 0.02432818459201448\n", + "Nights Watch brother | BC: 0.022719177729567438\n" ] } ], @@ -1488,7 +1524,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 59, "id": "51741a10", "metadata": {}, "outputs": [ @@ -1499,8 +1535,8 @@ "Victim: Bolton soldier | Kill count: 20\n", "Victim: Lannister soldier | Kill count: 7\n", "Victim: Daenerys Targaryen | Kill count: 1\n", - "Victim: Olly | Kill count: 1\n", "Victim: Stark Soldier | Kill count: 1\n", + "Victim: Olly | Kill count: 1\n", "Victim: Alliser Thorne | Kill count: 1\n", "Victim: Othell Yarwyck | Kill count: 1\n", "Victim: Bowen Marsh | Kill count: 1\n" @@ -1533,7 +1569,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 60, "id": "65e19f9e", "metadata": {}, "outputs": [ @@ -1566,7 +1602,7 @@ "id": "79ff8390", "metadata": {}, "source": [ - "\"movies_graph_model\"" + "\"movies_graph_model\"" ] }, { @@ -1579,7 +1615,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 61, "id": "b99e8f42", "metadata": {}, "outputs": [ @@ -1591,12 +1627,12 @@ "Traitor: Ramsay Bolton | Kill count: 4\n", "Traitor: Theon Greyjoy | Kill count: 4\n", "Traitor: Sandor the Hound Clegane | Kill count: 3\n", - "Traitor: Reek | Kill count: 2\n", - "Traitor: Euron Greyjoy | Kill count: 2\n", - "Traitor: Daario Naharis | Kill count: 2\n", "Traitor: Gregor the Mountain Clegane | Kill count: 2\n", "Traitor: Daenerys Targaryen | Kill count: 2\n", - "Traitor: Tyrion Lannister | Kill count: 2\n" + "Traitor: Reek | Kill count: 2\n", + "Traitor: Euron Greyjoy | Kill count: 2\n", + "Traitor: Karl Tanner | Kill count: 2\n", + "Traitor: Daario Naharis | Kill count: 2\n" ] } ], @@ -1628,12 +1664,12 @@ "id": "8f3f6dad", "metadata": {}, "source": [ - "Memgraph supports graph algorithms as well. Let's use **Dijkstra's shortest path algorithm** to show the most gruesome path of kills. An example kill path is: Jon Snow killed 5 Lannister Soldiers and they killed 10 Stark soldiers with total kill_count of 15." + "Memgraph supports graph algorithms as well. Let's use **Dijkstra's shortest path algorithm** to show the shortest path of killings with highest kill count. An example kill path is: Jon Snow killed 5 Lannister Soldiers and they killed 10 Stark soldiers with total kill_count of 15." ] }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 63, "id": "cef0423c", "metadata": { "scrolled": true @@ -1670,7 +1706,7 @@ "id": "418bbd38", "metadata": {}, "source": [ - "That's it! Hopefully, you gained new knowledge and enjoyed this workshop. If you have any questions, don't hesitate to contact me directly or [join our Discord server](https://discord.gg/memgraph)." + "That's it! Hopefully, you gained new knowledge and enjoyed this workshop. If you have any questions, don't hesitate to contact us directly or [join our Discord server](https://discord.gg/memgraph)." ] } ],