DIGITS-CNN/cars/split-investigations/split.ipynb

120 lines
89 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib as mpl\n",
"from matplotlib import pyplot as plt\n",
"\n",
"fig_dpi = 200"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Different Train/Validation/Test Splits\n",
"\n",
"## Index\n",
"0. train prop\n",
"1. val prop\n",
"2. test prop\n",
"3. top-1 accuracy\n",
"4. top-5 accuracy\n",
"5. last val loss\n",
"6. last val accuracy"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"split_results = np.array([\n",
" [50, 5, 45, 8.14, 20.7, 5.77, 8.29],\n",
" [50, 25, 25, 7.91, 20.9, 5.59, 8.41],\n",
" [70, 15, 15, 15.81, 34.62, 4.92, 16.82],\n",
" [80, 10, 10, 20.94, 44.1, 4.39, 24.45],\n",
" [90, 5, 5, 20.62, 45.19, 4.17, 30.29]\n",
"])"
]
},
{
"cell_type": "code",
2021-04-29 00:53:46 +01:00
"execution_count": 6,
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 1000x600 with 1 Axes>",
2021-04-29 00:53:46 +01:00
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg height=\"207.754375pt\" version=\"1.1\" viewBox=\"0 0 352.350625 207.754375\" width=\"352.350625pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <metadata>\n <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <cc:Work>\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n <dc:date>2021-04-28T22:44:56.303233</dc:date>\n <dc:format>image/svg+xml</dc:format>\n <dc:creator>\n <cc:Agent>\n <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n </cc:Agent>\n </dc:creator>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs>\n <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n </defs>\n <g id=\"figure_1\">\n <g id=\"patch_1\">\n <path d=\"M 0 207.754375 \nL 352.350625 207.754375 \nL 352.350625 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n </g>\n <g id=\"axes_1\">\n <g id=\"patch_2\">\n <path d=\"M 72.790625 170.198125 \nL 338.788125 170.198125 \nL 338.788125 22.318125 \nL 72.790625 22.318125 \nz\n\" style=\"fill:#ffffff;\"/>\n </g>\n <g id=\"patch_3\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 72.790625 163.476307 \nL 116.095018 163.476307 \nL 116.095018 141.070246 \nL 72.790625 141.070246 \nz\n\" style=\"fill:#1f77b4;\"/>\n </g>\n <g id=\"patch_4\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 72.790625 135.468731 \nL 114.87143 135.468731 \nL 114.87143 113.06267 \nL 72.790625 113.06267 \nz\n\" style=\"fill:#1f77b4;\"/>\n </g>\n <g id=\"patch_5\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 72.790625 107.461155 \nL 156.899034 107.461155 \nL 156.899034 85.055095 \nL 72.790625 85.055095 \nz\n\" style=\"fill:#1f77b4;\"/>\n </g>\n <g id=\"patch_6\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 72.790625 79.45358 \nL 184.190378 79.45358 \nL 184.190378 57.047519 \nL 72.790625 57.047519 \nz\n\" style=\"fill:#1f77b4;\"/>\n </g>\n <g id=\"patch_7\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 72.790625 51.446004 \nL 182.487994 51.446004 \nL 182.487994 29.039943 \nL 72.790625 29.039943 \nz\n\" style=\"fill:#1f77b4;\"/>\n </g>\n <g id=\"patch_8\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 116.095018 163.476307 \nL 182.91359 163.476307 \nL 182.91359 141.070246 \nL 116.095018 141.070246 \nz\n\" style=\"fill:#ff7f0e;\"/>\n </g>\n <g id=\"patch_9\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 114.87143 135.468731 \nL 183.97758 135.468731 \nL 183.97758 113.06267 \nL 114.87143 113.06267 \nz\n\" style=\"fill:#ff7f0e;\"/>\n </g>\n <g id=\"patch_10\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 156.899034 107.461155 \nL 256.967294 107.461155 \nL 256.967294 85.055095 \nL 156.899034 85.055095 \nz\n\" style=\"fill:#ff7f0e;\"/>\n </g>\n <g id=\"patch_11\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 184.190378 79.45358 \nL 307.40042 79.45358 \nL 307.40042 57.047519 \nL 184.190378 57.047519 \nz\n\" style=\"fill:#ff7f0e;\"/>\n </g>\n <g id=\"patch_12\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 182.487994 51.446004 \nL 313.199165 51.446004 \nL 313.199165 29.039943 \nL 182.487994 29.039943 \nz\n\" style=\"fill:#ff7f0e;\"/>\n </g>\n <g id=\"matplotlib.axis_1\">\n <g id=\"xtick_1\">\n <g id=\"line2d_1\">\n <path clip-path=\"url(#pc2b17418aa)\" d=\"M 72.790625 170.198125 \nL 72.790625 22.318125 \n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\n </g>\n <g id=\"line2d_2\">\n <defs>\n <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"me8552f4a8d\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n </defs>\n <g>\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"72.790625\" xlink:href=\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yP+U11ovGa/zhKoZ/Ul6HQZmV+pmUpHEqZVw4mfm5VhVFxDbA8YxMqDqX8nqYXdU/E9iQ8vtuXqGgua5NKa+tNatdSUlsLq/qXRvYkfJzrwX8LiJenJln1qq5j5HX7esZmZG9eeb2hhs7xdTGXZT3hCdUjw+KiFOzx27fo/BZyheBAJdQ/n6C8jfT6CGzKXBGROyQg1u67TzKc7o2sFe1r9Us3FD+JodlpabH97YsVZ6zYygJaCMRvrzav3m1rxQc7HvXNsChlFUD7qQk23dT/tZ3ovy9TQe+HRHzM/P77SqKiNdQ/g80hpfMp6zN/U/Ke8xzKX8jUD4XbBARz8vMh7oFGREHMTLh3jWU3/+DVZyPMP73n64iYjnKZ4vtartvAv4AzKG8Vz6H8vOvCZwUEa/NzON7qH4F4LeU3/2DVZ3XU36eXSj/SwAOoHwJ3m5Z0mMoX5A0/JPyP/0uyu9yNcprZf0eYtIgTHRG782bt8lzo/yDvZeRbzlf2nT8w7VjF/VQ31Ys2lJ7EfDMNmXXoHRnfUwrFeUD9B9r9TwIvAOY2qLsNGAP4MQWx9av1TG7x+dkdu2c9Xso8wjlw/2bgGgqt0zT489QEvCZbeqN6mept0g+Z5DPN+UDQKNlcwHdW0WeWrveHGDGOF+D+9fqO6pL2WmMfPhM4Fbg+S3K7UaZA6BR7sJWr52q7FlNv8sFwEebyzf/Lkfx89Vfg21fU13qeHNTHY9pNaQkqocCm3eoZ3XKB9NGPaf3GHdPfzvVeYcDLwGmtzk+pfqdz6nqnkdZx7lV2RNrMRwPrNSm3LLVNb/V5vjylCSnUddvgA1blJtZxV9vnVqxTZ2zx/M77fIcHt30+z6X0lK/7DjqrP8+51X
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"split_labels = [f\"{int(i[0])}/{int(i[1])}/{int(i[2])}\" for i in split_results]\n",
"\n",
"fig = plt.figure(figsize=(5, 3))\n",
"fig.set_dpi(fig_dpi)\n",
"\n",
"plt.barh(range(len(split_labels)), [i[3] for i in split_results], tick_label=split_labels, label='Top-1')\n",
"plt.barh(range(len(split_labels)), [i[4] - i[3] for i in split_results], tick_label=split_labels, label='Top-5', left=[i[3] for i in split_results])\n",
"\n",
"plt.legend()\n",
"plt.grid(axis='x')\n",
"plt.title('Accuracy for Dataset Split Proportions')\n",
"plt.xlabel('% Test Accuracy')\n",
"plt.ylabel('Dataset Split (Train/Val/Test)')\n",
"\n",
2021-04-29 00:53:46 +01:00
"plt.xlim(0, 50)\n",
"\n",
"plt.tight_layout()\n",
"plt.savefig('split-barh.png')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"name": "pythonjvsc74a57bd0333605e348ea7c6bf4ca805dbc845da062650cb5bf1d8f33f5f4a9d3bca7d68b",
"display_name": "Python 3.9.3 ('.venv': venv)"
},
"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.9.3"
},
"metadata": {
"interpreter": {
"hash": "333605e348ea7c6bf4ca805dbc845da062650cb5bf1d8f33f5f4a9d3bca7d68b"
}
}
},
"nbformat": 4,
"nbformat_minor": 4
}