Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
udayRage committed Jul 22, 2023
1 parent 7a26e59 commit 80f5533
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions notebooks/CoMine.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true,
"authorship_tag": "ABX9TyPngp8+oDXe9zaNSxQAgoty",
"authorship_tag": "ABX9TyP+p0/A83h+MyttQqcBVQjS",
"include_colab_link": true
},
"kernelspec": {
Expand All @@ -30,7 +29,7 @@
{
"cell_type": "markdown",
"source": [
"# Finding correlated patterns in a transactional database using CP-growth"
"# Finding correlated patterns in a transactional database using CoMine"
],
"metadata": {
"id": "Aj6UkFAj3sHh"
Expand All @@ -39,7 +38,7 @@
{
"cell_type": "markdown",
"source": [
"This tutorial has three parts. In the first part, we describe the basic approach to find correlated patterns in a transactional database using the CP-growth algorithm. In the second part, we describe an advanced approach, where we evaluate the performance of CP-growth algorithm on a dataset at different *minimum support* values. In the final part, we describe an advanced approach, where we evaluate the performance of CP-growth algorithm on a dataset at different *minimum all-confidence* threshold values."
"This tutorial has three parts. In the first part, we describe the basic approach to find correlated patterns in a transactional database using the CoMine algorithm. In the second part, we describe an advanced approach, where we evaluate the performance of CoMine algorithm on a dataset at different *minimum support* values. In the final part, we describe an advanced approach, where we evaluate the performance of CoMine algorithm on a dataset at different *minimum all-confidence* threshold values."
],
"metadata": {
"id": "X-YPyS6G4AVR"
Expand Down Expand Up @@ -156,7 +155,7 @@
"# This is formatted as code\n",
"```\n",
"\n",
"## Part 1: Finding correlated patterns using CP-growth"
"## Part 1: Finding correlated patterns using CoMine"
],
"metadata": {
"id": "pCnHao5L6PRR"
Expand Down Expand Up @@ -291,7 +290,7 @@
{
"cell_type": "markdown",
"source": [
"### Step 4: Mining correlated patterns using CP-growth"
"### Step 4: Mining correlated patterns using CoMine"
],
"metadata": {
"id": "PlLmo9ZXDJkX"
Expand All @@ -300,9 +299,9 @@
{
"cell_type": "code",
"source": [
"from PAMI.correlatedPattern.basic import CPGrowth as alg #import the algorithm\n",
"from PAMI.correlatedPattern.basic import CoMine as alg #import the algorithm\n",
"\n",
"obj = alg.CPGrowth(iFile='Transactional_T10I4D100K.csv', minSup=minSup, minAllConf=minAllConf, sep='\\t') #initialize\n",
"obj = alg.CoMine(iFile='Transactional_T10I4D100K.csv', minSup=minSup, minAllConf=minAllConf, sep='\\t') #initialize\n",
"obj.startMine() #start the mining process\n",
"\n",
"obj.save('correlatedPatternsAtMinSupCount100_020.txt') #save the patterns\n",
Expand Down Expand Up @@ -365,7 +364,7 @@
{
"cell_type": "markdown",
"source": [
"## Part 2: Evaluating the CP-growth algorithm on a dataset at different minSup values"
"## Part 2: Evaluating the CoMine algorithm on a dataset at different minSup values"
],
"metadata": {
"id": "FUO1nBPoHXJN"
Expand All @@ -384,7 +383,7 @@
"cell_type": "code",
"source": [
"#Import the libraries\n",
"from PAMI.correlatedPattern.basic import CPGrowth as alg #import the algorithm\n",
"from PAMI.correlatedPattern.basic import CoMine as alg #import the algorithm\n",
"import pandas as pd\n",
"\n",
"#Specify the input parameters\n",
Expand Down Expand Up @@ -455,10 +454,10 @@
"cell_type": "code",
"source": [
"for minSup in minSupValues:\n",
" obj = alg.CPGrowth(inputFile, minSup=minSup,minAllConf=minAllConf,sep=seperator)\n",
" obj = alg.CoMine(inputFile, minSup=minSup,minAllConf=minAllConf,sep=seperator)\n",
" obj.startMine()\n",
" #store the results in the data frame\n",
" result.loc[result.shape[0]] = ['CP-growth', minSup, len(obj.getPatterns()), obj.getRuntime(), obj.getMemoryRSS()]"
" result.loc[result.shape[0]] = ['CoMine', minSup, len(obj.getPatterns()), obj.getRuntime(), obj.getMemoryRSS()]"
],
"metadata": {
"id": "9ivJHoSEJlky"
Expand Down Expand Up @@ -521,7 +520,7 @@
{
"cell_type": "markdown",
"source": [
"## Part 3: Evaluating the CP-growth algorithm on a dataset at different minAllConf values"
"## Part 3: Evaluating the CoMine algorithm on a dataset at different minAllConf values"
],
"metadata": {
"id": "RO1D1sWIkn9J"
Expand All @@ -540,7 +539,7 @@
"cell_type": "code",
"source": [
"#Import the libraries\n",
"from PAMI.correlatedPattern.basic import CPGrowth as alg #import the algorithm\n",
"from PAMI.correlatedPattern.basic import CoMine as alg #import the algorithm\n",
"import pandas as pd\n",
"\n",
"#Specify the input parameters\n",
Expand Down Expand Up @@ -593,7 +592,7 @@
" obj = alg.CPGrowth(inputFile, minSup=minSupCount,minAllConf=minAllConf,sep=seperator)\n",
" obj.startMine()\n",
" #store the results in the data frame\n",
" result.loc[result.shape[0]] = ['CP-growth', minAllConf, len(obj.getPatterns()), obj.getRuntime(), obj.getMemoryRSS()]"
" result.loc[result.shape[0]] = ['CoMine', minAllConf, len(obj.getPatterns()), obj.getRuntime(), obj.getMemoryRSS()]"
],
"metadata": {
"id": "HhoI6jP7lWsD"
Expand Down

0 comments on commit 80f5533

Please sign in to comment.