PAMI - An Open Source PAttern MIning Python Library

PAMI is a Python library containing 100+ algorithms to discover useful patterns in various databases across multiple computing platforms. (Active)

Previous 🏠 Home Next

Creation of temporal database

This page describes the process to create synthetic transactional databases of varying sizes. Please note that this code is different from the widely used synthetic IBM data generator. <– Return to home page

Creation of temporal databases

This page describes the process to create synthetic temporal databases of varying sizes. The users can create different types of temporal databases.

Please note that all of the above forms of temporal databases can be created by varying the input parameters.

Step 1: Import the program

A synthetic transactional database can be created by calling generateTransactionalDatabase class in PAMI.extras.generateDatabase.

import PAMI.extras.generateDatabase.generateTemporalDatabase as dbGenerator

Step 2: Specify the parameters

totalNumberOfTransactions_D=1000     #Number of transactions that must exist in a database. Symbol used for this term is D
totalNumberOfItems_I=500      #total number of items that must exist in a database. Symbol used for this term is I
maximumLengthOfTransaction_T=20  #Maximum number of items that must exist in a database
probabilityOfRecurrenceOfTimeStamp_P=0   #Set the above value to 0 to create an irregular temporal database of Type-II.

sep = '\t'    "Specify the seperator. \t is the default seperator"
outputFile='D1000I500T20P0.tsv'   #Specify the file name. 
# 'D' represents the database size, 
# 'I' represents the total number of items and 
# 'P' represents the probability of occurrence of an item in a database

Step 3: Creating the synthetic dataset

temporalDB = generateTemporalDatabase(totalNumberOfTransactions, totalNumberOfItems,temporalDB = generateTemporalDatabase(numOfTransactions, maxNumOfItems, maxNumOfItemsPerTransaction, outFileName, percent, sep)


temporalDB.createTemporalFile()