Skip to content

Commit

Permalink
Merge branch 'main' of github.com:detiuaveiro/aas
Browse files Browse the repository at this point in the history
  • Loading branch information
mariolpantunes committed Oct 12, 2023
2 parents 7324a84 + 0c87147 commit 855dfda
Show file tree
Hide file tree
Showing 18 changed files with 3,053 additions and 105 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
}
],
"source": [
"df = pl.read_csv('../datasets/spam.csv')\n",
"df = pl.read_csv('../../datasets/spam.csv')\n",
"df"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
}
],
"source": [
"df = pl.read_csv('../datasets/spam.csv')\n",
"df = pl.read_csv('../../datasets/spam.csv')\n",
"df"
]
},
Expand Down
38 changes: 14 additions & 24 deletions notebooks/notebook_03.ipynb → notebooks/00-spam/notebook_03.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -120,9 +120,16 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"MovieWriter imagemagick unavailable; using Pillow instead.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
Expand Down Expand Up @@ -206,34 +213,17 @@
" return ax, pbest_plot, p_plot, p_arrow, gbest_plot\n",
" \n",
"anim = FuncAnimation(fig, animate, frames=list(range(1,50)), interval=500, blit=False, repeat=True)\n",
"anim.save(\"resources/PSO.gif\", dpi=120, writer=\"imagemagick\")\n",
"anim.save(\"../resources/PSO.gif\", dpi=120, writer=\"imagemagick\")\n",
" \n",
"print(\"PSO found best solution at f({})={}\".format(gbest, gbest_obj))\n",
"print(\"Global optimal at f({})={}\".format([x_min,y_min], f(x_min,y_min)))"
]
},
{
"cell_type": "code",
"execution_count": 11,
"cell_type": "markdown",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"resources/PSO.gif\" />"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Displaying animation\n",
"HTML('<img src=\"resources/PSO.gif\" />')"
"![title](../resources/PSO.gif)"
]
},
{
Expand Down Expand Up @@ -264,7 +254,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.10.12"
},
"orig_nbformat": 4
},
Expand Down
1 change: 1 addition & 0 deletions notebooks/00-spam/notebook_04.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 300/300 [00:07<00:00, 40.16it/s]"
"100%|██████████| 300/300 [00:07<00:00, 40.28it/s]"
]
},
{
Expand Down Expand Up @@ -249,7 +249,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 1000/1000 [00:00<00:00, 40122.67it/s]"
"100%|██████████| 1000/1000 [00:00<00:00, 25139.08it/s]"
]
},
{
Expand Down Expand Up @@ -356,7 +356,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 300/300 [00:02<00:00, 104.94it/s]"
"100%|██████████| 300/300 [00:02<00:00, 103.55it/s]"
]
},
{
Expand Down Expand Up @@ -467,7 +467,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
" 1%| | 1/100 [00:00<01:25, 1.16it/s]"
" 1%| | 1/100 [00:00<01:23, 1.19it/s]"
]
},
{
Expand Down Expand Up @@ -585,7 +585,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
" 2%|▏ | 2/100 [00:00<00:47, 2.04it/s]"
" 2%|▏ | 2/100 [00:00<00:46, 2.11it/s]"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -462,19 +462,19 @@
"└────────┴───────────────────────────────────┘"
]
},
"execution_count": 15,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pl.read_csv('../datasets/spam.csv')\n",
"df = pl.read_csv('../../datasets/spam.csv')\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -487,7 +487,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -502,7 +502,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -512,7 +512,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 20,
"metadata": {},
"outputs": [
{
Expand All @@ -535,7 +535,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 21,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -568,7 +568,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 22,
"metadata": {},
"outputs": [
{
Expand Down
30 changes: 15 additions & 15 deletions notebooks/notebook_07.ipynb → notebooks/00-spam/notebook_07.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand All @@ -33,7 +33,7 @@
"True"
]
},
"execution_count": 4,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -82,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -93,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -127,19 +127,19 @@
"└────────┴───────────────────────────────────┘"
]
},
"execution_count": 6,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pl.read_csv('../datasets/spam.csv')\n",
"df = pl.read_csv('../../datasets/spam.csv')\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -150,7 +150,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -163,7 +163,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -183,7 +183,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -208,7 +208,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -217,9 +217,9 @@
"text": [
"LR 0.96 0.96 0.83\n",
"KNN 0.95 0.95 0.79\n",
"NB 0.50 0.56 0.27\n",
"RFC 0.97 0.96 0.85\n",
"MLP 0.97 0.97 0.87\n"
"NB 0.50 0.57 0.28\n",
"RFC 0.96 0.96 0.84\n",
"MLP 0.97 0.97 0.88\n"
]
}
],
Expand Down Expand Up @@ -266,7 +266,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.10.12"
},
"orig_nbformat": 4
},
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 855dfda

Please sign in to comment.