Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
udayRage committed Oct 20, 2023
1 parent d1e2dd6 commit 2069a62
Showing 1 changed file with 125 additions and 43 deletions.
168 changes: 125 additions & 43 deletions notebooks/multipleMinimumFrequentPatterns/basic/CFPGrowthPlus.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,45 +66,85 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: PAMI in /Users/udaykiranrage/Library/CloudStorage/Dropbox/Github/PAMI_new/venv/lib/python3.9/site-packages (2023.7.28.5)\r\n",
"Requirement already satisfied: psutil in /Library/Python/3.9/site-packages (from PAMI) (5.9.5)\r\n",
"Requirement already satisfied: pandas in /Library/Python/3.9/site-packages (from PAMI) (2.0.3)\r\n",
"Requirement already satisfied: plotly in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from PAMI) (5.15.0)\r\n",
"Requirement already satisfied: matplotlib in /Library/Python/3.9/site-packages (from PAMI) (3.7.2)\r\n",
"Requirement already satisfied: resource in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from PAMI) (0.2.1)\r\n",
"Requirement already satisfied: validators in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from PAMI) (0.20.0)\r\n",
"Requirement already satisfied: urllib3 in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from PAMI) (2.0.3)\r\n",
"Requirement already satisfied: Pillow in /Library/Python/3.9/site-packages (from PAMI) (10.0.0)\r\n",
"Requirement already satisfied: numpy in /Library/Python/3.9/site-packages (from PAMI) (1.25.0)\r\n",
"Requirement already satisfied: contourpy>=1.0.1 in /Library/Python/3.9/site-packages (from matplotlib->PAMI) (1.1.0)\r\n",
"Requirement already satisfied: cycler>=0.10 in /Library/Python/3.9/site-packages (from matplotlib->PAMI) (0.11.0)\r\n",
"Requirement already satisfied: fonttools>=4.22.0 in /Library/Python/3.9/site-packages (from matplotlib->PAMI) (4.40.0)\r\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Python/3.9/site-packages (from matplotlib->PAMI) (1.4.4)\r\n",
"Requirement already satisfied: packaging>=20.0 in /Library/Python/3.9/site-packages (from matplotlib->PAMI) (23.1)\r\n",
"Requirement already satisfied: pyparsing<3.1,>=2.3.1 in /Library/Python/3.9/site-packages (from matplotlib->PAMI) (3.0.9)\r\n",
"Requirement already satisfied: python-dateutil>=2.7 in /Library/Python/3.9/site-packages (from matplotlib->PAMI) (2.8.2)\r\n",
"Requirement already satisfied: importlib-resources>=3.2.0 in /Library/Python/3.9/site-packages (from matplotlib->PAMI) (5.12.0)\r\n",
"Requirement already satisfied: pytz>=2020.1 in /Library/Python/3.9/site-packages (from pandas->PAMI) (2023.3)\r\n",
"Requirement already satisfied: tzdata>=2022.1 in /Library/Python/3.9/site-packages (from pandas->PAMI) (2023.3)\r\n",
"Requirement already satisfied: tenacity>=6.2.0 in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from plotly->PAMI) (8.2.2)\r\n",
"Requirement already satisfied: JsonForm>=0.0.2 in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from resource->PAMI) (0.0.2)\r\n",
"Requirement already satisfied: JsonSir>=0.0.2 in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from resource->PAMI) (0.0.2)\r\n",
"Requirement already satisfied: python-easyconfig>=0.1.0 in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from resource->PAMI) (0.1.7)\r\n",
"Requirement already satisfied: decorator>=3.4.0 in /Library/Python/3.9/site-packages (from validators->PAMI) (5.1.1)\r\n",
"Requirement already satisfied: zipp>=3.1.0 in /Users/udaykiranrage/Library/Python/3.9/lib/python/site-packages (from importlib-resources>=3.2.0->matplotlib->PAMI) (3.15.0)\r\n",
"Requirement already satisfied: jsonschema in /Library/Python/3.9/site-packages (from JsonForm>=0.0.2->resource->PAMI) (4.18.4)\r\n",
"Requirement already satisfied: six>=1.5 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib->PAMI) (1.15.0)\r\n",
"Requirement already satisfied: PyYAML in /Library/Python/3.9/site-packages (from python-easyconfig>=0.1.0->resource->PAMI) (6.0.1)\r\n",
"Requirement already satisfied: attrs>=22.2.0 in /Library/Python/3.9/site-packages (from jsonschema->JsonForm>=0.0.2->resource->PAMI) (23.1.0)\r\n",
"Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /Library/Python/3.9/site-packages (from jsonschema->JsonForm>=0.0.2->resource->PAMI) (2023.6.1)\r\n",
"Requirement already satisfied: referencing>=0.28.4 in /Library/Python/3.9/site-packages (from jsonschema->JsonForm>=0.0.2->resource->PAMI) (0.29.3)\r\n",
"Requirement already satisfied: rpds-py>=0.7.1 in /Library/Python/3.9/site-packages (from jsonschema->JsonForm>=0.0.2->resource->PAMI) (0.8.11)\r\n"
"Collecting PAMI\n",
" Downloading pami-2023.10.20.3-py3-none-any.whl (873 kB)\n",
"\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/873.8 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━━\u001b[0m\u001b[90m╺\u001b[0m\u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m204.8/873.8 kB\u001b[0m \u001b[31m6.1 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m\u001b[90m━━━━━━━━━━━\u001b[0m \u001b[32m624.6/873.8 kB\u001b[0m \u001b[31m9.1 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m873.8/873.8 kB\u001b[0m \u001b[31m8.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from PAMI) (5.9.5)\n",
"Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from PAMI) (1.5.3)\n",
"Requirement already satisfied: plotly in /usr/local/lib/python3.10/dist-packages (from PAMI) (5.15.0)\n",
"Requirement already satisfied: matplotlib in /usr/local/lib/python3.10/dist-packages (from PAMI) (3.7.1)\n",
"Collecting resource (from PAMI)\n",
" Downloading Resource-0.2.1-py2.py3-none-any.whl (25 kB)\n",
"Collecting validators (from PAMI)\n",
" Downloading validators-0.22.0-py3-none-any.whl (26 kB)\n",
"Requirement already satisfied: urllib3 in /usr/local/lib/python3.10/dist-packages (from PAMI) (2.0.7)\n",
"Requirement already satisfied: Pillow in /usr/local/lib/python3.10/dist-packages (from PAMI) (9.4.0)\n",
"Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from PAMI) (1.23.5)\n",
"Collecting sphinx-rtd-theme (from PAMI)\n",
" Downloading sphinx_rtd_theme-1.3.0-py2.py3-none-any.whl (2.8 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.8/2.8 MB\u001b[0m \u001b[31m19.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->PAMI) (1.1.1)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib->PAMI) (0.12.1)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->PAMI) (4.43.1)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->PAMI) (1.4.5)\n",
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->PAMI) (23.2)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->PAMI) (3.1.1)\n",
"Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib->PAMI) (2.8.2)\n",
"Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->PAMI) (2023.3.post1)\n",
"Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from plotly->PAMI) (8.2.3)\n",
"Collecting JsonForm>=0.0.2 (from resource->PAMI)\n",
" Downloading JsonForm-0.0.2.tar.gz (2.4 kB)\n",
" Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
"Collecting JsonSir>=0.0.2 (from resource->PAMI)\n",
" Downloading JsonSir-0.0.2.tar.gz (2.2 kB)\n",
" Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
"Collecting python-easyconfig>=0.1.0 (from resource->PAMI)\n",
" Downloading Python_EasyConfig-0.1.7-py2.py3-none-any.whl (5.4 kB)\n",
"Requirement already satisfied: sphinx<8,>=1.6 in /usr/local/lib/python3.10/dist-packages (from sphinx-rtd-theme->PAMI) (5.0.2)\n",
"Requirement already satisfied: docutils<0.19 in /usr/local/lib/python3.10/dist-packages (from sphinx-rtd-theme->PAMI) (0.18.1)\n",
"Collecting sphinxcontrib-jquery<5,>=4 (from sphinx-rtd-theme->PAMI)\n",
" Downloading sphinxcontrib_jquery-4.1-py2.py3-none-any.whl (121 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m121.1/121.1 kB\u001b[0m \u001b[31m14.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: jsonschema in /usr/local/lib/python3.10/dist-packages (from JsonForm>=0.0.2->resource->PAMI) (4.19.1)\n",
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib->PAMI) (1.16.0)\n",
"Requirement already satisfied: PyYAML in /usr/local/lib/python3.10/dist-packages (from python-easyconfig>=0.1.0->resource->PAMI) (6.0.1)\n",
"Requirement already satisfied: sphinxcontrib-applehelp in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (1.0.7)\n",
"Requirement already satisfied: sphinxcontrib-devhelp in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (1.0.5)\n",
"Requirement already satisfied: sphinxcontrib-jsmath in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (1.0.1)\n",
"Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (2.0.4)\n",
"Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.5 in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (1.1.9)\n",
"Requirement already satisfied: sphinxcontrib-qthelp in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (1.0.6)\n",
"Requirement already satisfied: Jinja2>=2.3 in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (3.1.2)\n",
"Requirement already satisfied: Pygments>=2.0 in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (2.16.1)\n",
"Requirement already satisfied: snowballstemmer>=1.1 in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (2.2.0)\n",
"Requirement already satisfied: babel>=1.3 in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (2.13.0)\n",
"Requirement already satisfied: alabaster<0.8,>=0.7 in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (0.7.13)\n",
"Requirement already satisfied: imagesize in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (1.4.1)\n",
"Requirement already satisfied: requests>=2.5.0 in /usr/local/lib/python3.10/dist-packages (from sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (2.31.0)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from Jinja2>=2.3->sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (2.1.3)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.5.0->sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (3.3.0)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.5.0->sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (3.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.5.0->sphinx<8,>=1.6->sphinx-rtd-theme->PAMI) (2023.7.22)\n",
"Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema->JsonForm>=0.0.2->resource->PAMI) (23.1.0)\n",
"Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema->JsonForm>=0.0.2->resource->PAMI) (2023.7.1)\n",
"Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema->JsonForm>=0.0.2->resource->PAMI) (0.30.2)\n",
"Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema->JsonForm>=0.0.2->resource->PAMI) (0.10.6)\n",
"Building wheels for collected packages: JsonForm, JsonSir\n",
" Building wheel for JsonForm (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
" Created wheel for JsonForm: filename=JsonForm-0.0.2-py3-none-any.whl size=3313 sha256=5862581b94be584f02faafe6254373605572b379125646d3fd1f5f2a0d392201\n",
" Stored in directory: /root/.cache/pip/wheels/b6/e5/87/11026246d3bd4ad67c0615682d2d6748bbd9a40ac0490882bd\n",
" Building wheel for JsonSir (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
" Created wheel for JsonSir: filename=JsonSir-0.0.2-py3-none-any.whl size=4750 sha256=f5741cdd561b1435780f96e352fd445946d253a29f36b3c3750efa5c6f49bfd1\n",
" Stored in directory: /root/.cache/pip/wheels/1d/4c/d3/4d9757425983b43eb709be1043d82cd03fb863ce5f56f117e6\n",
"Successfully built JsonForm JsonSir\n",
"Installing collected packages: JsonSir, validators, python-easyconfig, JsonForm, resource, sphinxcontrib-jquery, sphinx-rtd-theme, PAMI\n",
"Successfully installed JsonForm-0.0.2 JsonSir-0.0.2 PAMI-2023.10.20.3 python-easyconfig-0.1.7 resource-0.2.1 sphinx-rtd-theme-1.3.0 sphinxcontrib-jquery-4.1 validators-0.22.0\n"
]
}
],
Expand All @@ -113,7 +153,10 @@
],
"metadata": {
"id": "bUhZQeQHNNt9",
"outputId": "1306f9c1-9598-4035-ebe7-b4b4ae62eb94"
"outputId": "f1f7ec8e-f656-46c6-b65d-62d3e92486b8",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"id": "bUhZQeQHNNt9"
},
Expand All @@ -133,11 +176,33 @@
"!wget https://u-aizu.ac.jp/~udayrage/datasets/transactionalDatabases/Transactional_T10I4D100K.csv"
],
"metadata": {
"id": "Y1O-Nun9r-Wf"
"id": "Y1O-Nun9r-Wf",
"outputId": "a9845f7f-1a21-442c-d23c-8f15bd1d21ef",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"id": "Y1O-Nun9r-Wf",
"execution_count": null,
"outputs": []
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"--2023-10-20 07:57:18-- https://u-aizu.ac.jp/~udayrage/datasets/transactionalDatabases/Transactional_T10I4D100K.csv\n",
"Resolving u-aizu.ac.jp (u-aizu.ac.jp)... 150.95.161.176, 150.31.244.160\n",
"Connecting to u-aizu.ac.jp (u-aizu.ac.jp)|150.95.161.176|:443... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
"Length: 4019277 (3.8M) [text/csv]\n",
"Saving to: ‘Transactional_T10I4D100K.csv’\n",
"\n",
"Transactional_T10I4 100%[===================>] 3.83M 1.09MB/s in 3.5s \n",
"\n",
"2023-10-20 07:57:23 (1.09 MB/s) - ‘Transactional_T10I4D100K.csv’ saved [4019277/4019277]\n",
"\n"
]
}
]
},
{
"cell_type": "markdown",
Expand All @@ -159,15 +224,32 @@
"sep = \"\\t\"\n",
"output = \"MIS_T10.txt\"\n",
"cd = ub.usingBeta(inputFile, beta, LS, sep)\n",
"cd.calculateMISValues()\n",
"cd.calculateMIS()\n",
"cd.save(output)"
],
"metadata": {
"id": "KuVAA2spsJ91"
"id": "KuVAA2spsJ91",
"outputId": "d0468419-5400-4f10-97c5-897cd9f2ab8b",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 232
}
},
"id": "KuVAA2spsJ91",
"execution_count": null,
"outputs": []
"execution_count": 3,
"outputs": [
{
"output_type": "error",
"ename": "AttributeError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-3-acc585bbd937>\u001b[0m in \u001b[0;36m<cell line: 8>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0moutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"MIS_T10.txt\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mcd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mub\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0musingBeta\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputFile\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbeta\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mLS\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msep\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 8\u001b[0;31m \u001b[0mcd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcalculateMISValues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 9\u001b[0m \u001b[0mcd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msave\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0moutput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'usingBeta' object has no attribute 'calculateMISValues'"
]
}
]
},
{
"cell_type": "markdown",
Expand Down

0 comments on commit 2069a62

Please sign in to comment.