5 "execution_count": null,
6 "id": "af683b2e-8e70-403c-ab28-1cfdc314b4d5",
10 "import pandas as pd\n",
11 "from data_funcs import from_json\n",
12 "import matplotlib.pyplot as plt"
17 "execution_count": null,
18 "id": "365b3157-b5db-4cd1-8095-4f847f24d682",
24 "rnn = from_json(\"rnn_errs.json\")\n",
25 "kf = from_json(\"kf_errs.json\")"
30 "execution_count": null,
31 "id": "e4faafed-6678-4164-a6e3-649d01fd63c7",
35 "# Remove \"filename\" key\n",
36 "del rnn['filename']\n",
42 "execution_count": null,
43 "id": "19b9744c-a4db-4aab-a054-e402269b9f4d",
47 "# Prepare lists to store the extracted values\n",
51 "# Iterate through the dictionary to extract the needed values\n",
52 "for key, value in rnn.items():\n",
53 " cases.append(value['case'])\n",
54 " predictions.append(value['errs']['prediction'])\n",
56 "# Create the DataFrame\n",
57 "df1 = pd.DataFrame({\n",
59 " 'prediction': predictions\n",
65 "execution_count": null,
66 "id": "0b961e18-47c9-40a9-9b63-178d7fad27e4",
75 "execution_count": null,
76 "id": "690b32ea-4a80-4a44-a7e6-6dd9453041dc",
80 "df2 = pd.DataFrame.from_dict(kf).transpose()\n",
86 "execution_count": null,
87 "id": "6c5b2084-879d-4fb9-a25f-a57c3d239dde",
91 "plt.hist(df1.prediction, label = \"RNN\")\n",
92 "plt.hist(df2.errs, label = \"KF\")\n",
98 "execution_count": null,
99 "id": "403c87cb-85c1-4059-9d9c-087d0fd33f9b",
103 "print(df1.prediction.mean())\n",
104 "print(df1.prediction.median())"
109 "execution_count": null,
110 "id": "0a36faff-9b98-4a80-b464-0973909d5e8f",
114 "print(df2.errs.mean())\n",
115 "print(df2.errs.median())"
120 "execution_count": null,
121 "id": "4355db09-2232-4526-ba96-42da4cd44ce3",
128 "execution_count": null,
129 "id": "5b7a4469-ad9a-4b6a-8982-31873d39e43d",
137 "display_name": "Python 3 (ipykernel)",
138 "language": "python",
146 "file_extension": ".py",
147 "mimetype": "text/x-python",
149 "nbconvert_exporter": "python",
150 "pygments_lexer": "ipython3",