PAMI
PAMI is a Python library containing 100+ algorithms to discover useful patterns in various databases across multiple computing platforms. (Active)
Install / Use
/learn @UdayLab/PAMIREADME
Click here for more information
Table of Contents
- Introduction
- Development process
- Inputs and outputs of a PAMI algorithm
- Recent updates
- Features
- Maintenance
- Try your first PAMI program
- Evaluation
- Reading Material
- License
- Documentation
- Background
- Getting Help
- Discussion and Development
- Contribution to PAMI
- Tutorials
- Association rule mining
- Mining transactional databases
- Mining temporal databases
- Mining spatiotemporal databases
- Mining utility databases
- Mining fuzzy databases
- Mining uncertain databases
- Mining sequence databases
- Mining multiple timeseries
- Mining streams
- Mining character sequences
- Mining graphs
- Additional features
- Real-World Case Studies
Introduction
PAttern MIning (PAMI) is a Python library containing several algorithms to discover user interest-based patterns in a wide-spectrum of datasets across multiple computing platforms. Useful links to utilize the services of this library were provided below:
-
Youtube tutorial https://www.youtube.com/playlist?list=PLKP768gjVJmDer6MajaLbwtfC9ULVuaCZ
-
Tutorials (Notebooks) https://github.com/UdayLab/PAMI/tree/main/notebooks
-
User manual https://udaylab.github.io/PAMI/manuals/index.html
-
Coders manual https://udaylab.github.io/PAMI/codersManual/index.html
-
Code documentation https://pami-1.readthedocs.io
-
Datasets https://u-aizu.ac.jp/~udayrage/datasets.html
-
Discussions on PAMI usage https://github.com/UdayLab/PAMI/discussions
-
Report issues https://github.com/UdayLab/PAMI/issues
Flow Chart of Developing Algorithms in PAMI

Inputs and Outputs of an Algorithm in PAMI

Recent Updates
- Version 2024.07.02:
In this latest version, the following updates have been made:
- Included one new algorithms, PrefixSpan, for Sequential Pattern.
- Optimized the following pattern mining algorithms: PFPGrowth, PFECLAT, GPFgrowth and PPF_DFS.
- Test cases are implemented for the following algorithms, Contiguous Frequent patterns, Correlated Frequent Patterns, Coverage Frequent Patterns, Fuzzy Correlated Frequent Patterns, Fuzzy Frequent Patterns, Fuzzy Georeferenced Patterns, Georeferenced Frequent Patterns, Periodic Frequent Patterns, Partial Periodic Frequent Patterns, HighUtility Frequent Patterns, HighUtility Patterns, HighUtility Georeferenced Frequent Patterns, Frequent Patterns, Multiple Minimum Frequent Patterns, Periodic Frequent Patterns, Recurring Patterns, Sequential Patterns, Uncertain Frequent Patterns, Weighted Uncertain Frequent Patterns.
- The algorithms mentioned below are automatically tested, Frequent Patterns, Correlated Frequent Patterns, Contiguous Frequent patterns, Coverage Frequent Patterns, Recurring Patterns, Sequential Patterns.
Total number of algorithms: 89
Features
- ✅ Tested to the best of our possibility
- 🔋 Highly optimized to our best effort, light-weight, and energy-efficient
- 👀 Proper code documentation
- 🍼 Ample examples of using various algorithms at ./notebooks folder
- 🤖 Works with AI libraries such as TensorFlow, PyTorch, and sklearn.
- ⚡️ Supports Cuda and PySpark
- 🖥️ Operating System Independence
- 🔬 Knowledge discovery in static data and streams
- 🐎 Snappy
- 🐻 Ease of use
Maintenance
Installation
-
Installing basic pami package (recommended)
pip install pami -
Installing pami package in a GPU machine that supports CUDA
pip install 'pami[gpu]' -
Installing pami package in a distributed network environment supporting Spark
pip install 'pami[spark]' -
Installing pami package for developing purpose
pip install 'pami[dev]' -
Installing complete Library of pami
pip install 'pami[all]'
Upgradation
pip install --upgrade pami
Uninstallation
pip uninstall pami
Information
pip show pami
Try your first PAMI program
$ python
# first import pami
from PAMI.frequentPattern.basic import FPGrowth as alg
fileURL = "https://u-aizu.ac.jp/~udayrage/datasets/transactionalDatabases/Transactional_T10I4D100K.csv"
minSup=300
obj = alg.FPGrowth(iFile=fileURL, minSup=minSup, sep='\t')
#obj.mine() #deprecated
obj.mine()
obj.save('frequentPatternsAtMinSupCount300.txt')
frequentPatternsDF= obj.getPatternsAsDataFrame()
print('Total No of patterns: ' + str(len(frequentPatternsDF))) #print the total number of patterns
print('Runtime: ' + str(obj.getRuntime())) #measure the runtime
print('Memory (RSS): ' + str(obj.getMemoryRSS()))
print('Memory (USS): ' + str(obj.getMemoryUSS()))
Output:
Frequent patterns were generated successfully using frequentPatternGrowth algorithm
Total No of patterns: 4540
Runtime: 8.749667644500732
Memory (RSS): 522911744
Memory (USS): 475353088
Evaluation:
- we compared three different Python libraries such as PAMI, mlxtend and efficient-apriori for Apriori.
- (Transactional_T10I4D100K.csv)is a transactional database downloaded from PAMI and used as an input file for all libraries.
- Minimum support values and seperator are also same.
- The performance of the Apriori algorithm is shown in the graphical results below:
-
Comparing the Patterns Generated by different Python libraries for the Apriori algorithm:
<img width="573" alt="Screenshot 2024-04-11 at 13 31 31" src="https://github.com/vanithakattumuri/PAMI/assets/134862983/fd7974bc-ffe2-44dd-82e3-a5306a8a23bd"> -
Evaluating the Runtime of the Apriori algorithm across different Python libraries:
<img width="567" alt="Screenshot 2024-04-11 at 13 31 20" src="https://github.com/vanithakattumuri/PAMI/assets/134862983/5d615ae3-dc0d-49ba-a880-4890bb1f11c5"> -
Comparing the Memory Consumption of the Apriori algorithm across different Python libraries:
<img width="570" alt="Screenshot 2024-04-11 at 13 31 08" src="https://github.com/vanithakattumuri/PAMI/assets/134862983/5d5991ca-51ae-442d-9b5e-2d21bbebfedd">
For more information, we have uploaded the evaluation file in two formats:
- One ipynb file format, please check it here. Evaluation File ipynb
- Two pdf file format, check here. Evaluation File Pdf
Reading Material
For more examples, refer this YouTube link [YouTube](https://www.youtube.com/playlist?list=PLKP768gjVJmDer6Ma
