Commit f233bfcb authored by Almouhannad's avatar Almouhannad

Add Table of contents to hw1.ipynb

parent 21e6ee8a
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ***Contents:***\n",
"* <a href=\"#0-setup\">0. Setup</a> \n",
"* <a href=\"#1-data-preprocessing\">1. Data-preprocessing</a> \n",
"* <a href=\"#2-extracting-rules-using-apriori\">2. Extracting rules using apriori</a> \n",
"* <a href=\"#3-extracting-rules-using-fp-growth\">3. Extracting rules using FP Growth</a> \n",
"* <a href=\"#4-performance-comparison\">4. Performance comparison</a> "
]
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -18,46 +30,10 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: pandas in d:\\programs\\anaconda3\\lib\\site-packages (2.1.4)\n",
"Requirement already satisfied: numpy<2,>=1.23.2 in d:\\programs\\anaconda3\\lib\\site-packages (from pandas) (1.26.4)\n",
"Requirement already satisfied: python-dateutil>=2.8.2 in d:\\programs\\anaconda3\\lib\\site-packages (from pandas) (2.8.2)\n",
"Requirement already satisfied: pytz>=2020.1 in d:\\programs\\anaconda3\\lib\\site-packages (from pandas) (2023.3.post1)\n",
"Requirement already satisfied: tzdata>=2022.1 in d:\\programs\\anaconda3\\lib\\site-packages (from pandas) (2023.3)\n",
"Requirement already satisfied: six>=1.5 in d:\\programs\\anaconda3\\lib\\site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)\n",
"Note: you may need to restart the kernel to use updated packages.\n",
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: mlxtend in c:\\users\\toshiba\\appdata\\roaming\\python\\python311\\site-packages (0.23.1)\n",
"Requirement already satisfied: scipy>=1.2.1 in d:\\programs\\anaconda3\\lib\\site-packages (from mlxtend) (1.11.4)\n",
"Requirement already satisfied: numpy>=1.16.2 in d:\\programs\\anaconda3\\lib\\site-packages (from mlxtend) (1.26.4)\n",
"Requirement already satisfied: pandas>=0.24.2 in d:\\programs\\anaconda3\\lib\\site-packages (from mlxtend) (2.1.4)\n",
"Requirement already satisfied: scikit-learn>=1.0.2 in d:\\programs\\anaconda3\\lib\\site-packages (from mlxtend) (1.2.2)\n",
"Requirement already satisfied: matplotlib>=3.0.0 in d:\\programs\\anaconda3\\lib\\site-packages (from mlxtend) (3.8.0)\n",
"Requirement already satisfied: joblib>=0.13.2 in d:\\programs\\anaconda3\\lib\\site-packages (from mlxtend) (1.2.0)\n",
"Requirement already satisfied: contourpy>=1.0.1 in d:\\programs\\anaconda3\\lib\\site-packages (from matplotlib>=3.0.0->mlxtend) (1.2.0)\n",
"Requirement already satisfied: cycler>=0.10 in d:\\programs\\anaconda3\\lib\\site-packages (from matplotlib>=3.0.0->mlxtend) (0.11.0)\n",
"Requirement already satisfied: fonttools>=4.22.0 in d:\\programs\\anaconda3\\lib\\site-packages (from matplotlib>=3.0.0->mlxtend) (4.25.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in d:\\programs\\anaconda3\\lib\\site-packages (from matplotlib>=3.0.0->mlxtend) (1.4.4)\n",
"Requirement already satisfied: packaging>=20.0 in d:\\programs\\anaconda3\\lib\\site-packages (from matplotlib>=3.0.0->mlxtend) (23.1)\n",
"Requirement already satisfied: pillow>=6.2.0 in d:\\programs\\anaconda3\\lib\\site-packages (from matplotlib>=3.0.0->mlxtend) (10.2.0)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in d:\\programs\\anaconda3\\lib\\site-packages (from matplotlib>=3.0.0->mlxtend) (3.0.9)\n",
"Requirement already satisfied: python-dateutil>=2.7 in d:\\programs\\anaconda3\\lib\\site-packages (from matplotlib>=3.0.0->mlxtend) (2.8.2)\n",
"Requirement already satisfied: pytz>=2020.1 in d:\\programs\\anaconda3\\lib\\site-packages (from pandas>=0.24.2->mlxtend) (2023.3.post1)\n",
"Requirement already satisfied: tzdata>=2022.1 in d:\\programs\\anaconda3\\lib\\site-packages (from pandas>=0.24.2->mlxtend) (2023.3)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in d:\\programs\\anaconda3\\lib\\site-packages (from scikit-learn>=1.0.2->mlxtend) (2.2.0)\n",
"Requirement already satisfied: six>=1.5 in d:\\programs\\anaconda3\\lib\\site-packages (from python-dateutil>=2.7->matplotlib>=3.0.0->mlxtend) (1.16.0)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"outputs": [],
"source": [
"%pip install pandas\n",
"%pip install mlxtend"
"# %pip install pandas\n",
"# %pip install mlxtend"
]
},
{
......@@ -626,7 +602,7 @@
" <tr>\n",
" <th>7</th>\n",
" <td>0.200000</td>\n",
" <td>(Coffee, Pastry)</td>\n",
" <td>(Pastry, Coffee)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
......@@ -646,7 +622,7 @@
"4 0.400000 (Pastry)\n",
"5 0.200000 (Scandinavian)\n",
"6 0.200000 (Pastry, Bread)\n",
"7 0.200000 (Coffee, Pastry)\n",
"7 0.200000 (Pastry, Coffee)\n",
"8 0.200000 (Pastry, Medialuna)"
]
},
......@@ -730,29 +706,29 @@
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>(Coffee)</td>\n",
" <td>(Pastry)</td>\n",
" <td>0.266667</td>\n",
" <td>(Coffee)</td>\n",
" <td>0.400000</td>\n",
" <td>0.266667</td>\n",
" <td>0.2</td>\n",
" <td>0.75</td>\n",
" <td>0.50</td>\n",
" <td>1.875000</td>\n",
" <td>0.093333</td>\n",
" <td>2.400000</td>\n",
" <td>0.636364</td>\n",
" <td>1.466667</td>\n",
" <td>0.777778</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>(Pastry)</td>\n",
" <td>(Coffee)</td>\n",
" <td>0.400000</td>\n",
" <td>(Pastry)</td>\n",
" <td>0.266667</td>\n",
" <td>0.400000</td>\n",
" <td>0.2</td>\n",
" <td>0.50</td>\n",
" <td>0.75</td>\n",
" <td>1.875000</td>\n",
" <td>0.093333</td>\n",
" <td>1.466667</td>\n",
" <td>0.777778</td>\n",
" <td>2.400000</td>\n",
" <td>0.636364</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
......@@ -787,15 +763,15 @@
"text/plain": [
" antecedents consequents antecedent support consequent support support \\\n",
"0 (Pastry) (Bread) 0.400000 0.466667 0.2 \n",
"1 (Coffee) (Pastry) 0.266667 0.400000 0.2 \n",
"2 (Pastry) (Coffee) 0.400000 0.266667 0.2 \n",
"1 (Pastry) (Coffee) 0.400000 0.266667 0.2 \n",
"2 (Coffee) (Pastry) 0.266667 0.400000 0.2 \n",
"3 (Pastry) (Medialuna) 0.400000 0.333333 0.2 \n",
"4 (Medialuna) (Pastry) 0.333333 0.400000 0.2 \n",
"\n",
" confidence lift leverage conviction zhangs_metric \n",
"0 0.50 1.071429 0.013333 1.066667 0.111111 \n",
"1 0.75 1.875000 0.093333 2.400000 0.636364 \n",
"2 0.50 1.875000 0.093333 1.466667 0.777778 \n",
"1 0.50 1.875000 0.093333 1.466667 0.777778 \n",
"2 0.75 1.875000 0.093333 2.400000 0.636364 \n",
"3 0.50 1.500000 0.066667 1.333333 0.555556 \n",
"4 0.60 1.500000 0.066667 1.500000 0.500000 "
]
......@@ -945,7 +921,7 @@
" <tr>\n",
" <th>7</th>\n",
" <td>0.200000</td>\n",
" <td>(Coffee, Pastry)</td>\n",
" <td>(Pastry, Coffee)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
......@@ -965,7 +941,7 @@
"4 0.266667 (Coffee)\n",
"5 0.333333 (Medialuna)\n",
"6 0.200000 (Pastry, Bread)\n",
"7 0.200000 (Coffee, Pastry)\n",
"7 0.200000 (Pastry, Coffee)\n",
"8 0.200000 (Pastry, Medialuna)"
]
},
......@@ -1049,29 +1025,29 @@
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>(Coffee)</td>\n",
" <td>(Pastry)</td>\n",
" <td>0.266667</td>\n",
" <td>(Coffee)</td>\n",
" <td>0.400000</td>\n",
" <td>0.266667</td>\n",
" <td>0.2</td>\n",
" <td>0.75</td>\n",
" <td>0.50</td>\n",
" <td>1.875000</td>\n",
" <td>0.093333</td>\n",
" <td>2.400000</td>\n",
" <td>0.636364</td>\n",
" <td>1.466667</td>\n",
" <td>0.777778</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>(Pastry)</td>\n",
" <td>(Coffee)</td>\n",
" <td>0.400000</td>\n",
" <td>(Pastry)</td>\n",
" <td>0.266667</td>\n",
" <td>0.400000</td>\n",
" <td>0.2</td>\n",
" <td>0.50</td>\n",
" <td>0.75</td>\n",
" <td>1.875000</td>\n",
" <td>0.093333</td>\n",
" <td>1.466667</td>\n",
" <td>0.777778</td>\n",
" <td>2.400000</td>\n",
" <td>0.636364</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
......@@ -1106,15 +1082,15 @@
"text/plain": [
" antecedents consequents antecedent support consequent support support \\\n",
"0 (Pastry) (Bread) 0.400000 0.466667 0.2 \n",
"1 (Coffee) (Pastry) 0.266667 0.400000 0.2 \n",
"2 (Pastry) (Coffee) 0.400000 0.266667 0.2 \n",
"1 (Pastry) (Coffee) 0.400000 0.266667 0.2 \n",
"2 (Coffee) (Pastry) 0.266667 0.400000 0.2 \n",
"3 (Pastry) (Medialuna) 0.400000 0.333333 0.2 \n",
"4 (Medialuna) (Pastry) 0.333333 0.400000 0.2 \n",
"\n",
" confidence lift leverage conviction zhangs_metric \n",
"0 0.50 1.071429 0.013333 1.066667 0.111111 \n",
"1 0.75 1.875000 0.093333 2.400000 0.636364 \n",
"2 0.50 1.875000 0.093333 1.466667 0.777778 \n",
"1 0.50 1.875000 0.093333 1.466667 0.777778 \n",
"2 0.75 1.875000 0.093333 2.400000 0.636364 \n",
"3 0.50 1.500000 0.066667 1.333333 0.555556 \n",
"4 0.60 1.500000 0.066667 1.500000 0.500000 "
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment