PAMI is a Python library containing 100+ algorithms to discover useful patterns in various databases across multiple computing platforms. (Active)
GNU General Public License v3.0
242
stars
195
forks
source link
Bug in printing temporalDatabaseStats. #49
Closed
udayRage closed 1 year ago
The below program prints an item's minimum, average, and maximum periodicity in the database as 1, 1, and 1, respectively.
URL of the notebook: https://colab.research.google.com/github/UdayLab/PAMI/blob/main/notebooks/parallelFPGrowth.ipynb
import the class file
import PAMI.extras.dbStats.temporalDatabaseStats as stats
specify the file name
inputFile = 'Temporal_T10I4D100K.csv'
initialize the class
obj=stats.temporalDatabaseStats(inputFile,sep='\t')
execute the class
obj.run()
Printing each of the database statistics
print(f'Database size : {obj.getDatabaseSize()}') print(f'Total number of items : {obj.getTotalNumberOfItems()}') print(f'Database sparsity : {obj.getSparsity()}') print(f'Minimum Transaction Size : {obj.getMinimumTransactionLength()}') print(f'Average Transaction Size : {obj.getAverageTransactionLength()}') print(f'Maximum Transaction Size : {obj.getMaximumTransactionLength()}') print(f'Standard Deviation Transaction Size : {obj.getStandardDeviationTransactionLength()}') print(f'Variance in Transaction Sizes : {obj. getVarianceTransactionLength()}') print(f'Minimum period : {obj.getMinimumPeriod()}') print(f'Average period : {obj.getAveragePeriod()}') print(f'Maximum period : {obj.getMaximumPeriod()}')
itemFrequencies = obj.getSortedListOfItemFrequencies() transactionLength = obj.getTransanctionalLengthDistribution() numberOfTransactionPerTimeStamp = obj.getNumberOfTransactionsPerTimestamp() obj.save(itemFrequencies,'itemFrequency.csv') obj.save(transactionLength, 'transactionSize.csv') obj.save(numberOfTransactionPerTimeStamp, 'numberOfTransaction.csv')