Python implementation of ITPMiner algorithm
Project description
Inter-Transactional Patterns Miner(itpminer)
Python implementation of ITPMiner algorithm[1]
- Free software: MIT license
Features
- Mine frequent inter-transactional items
- Generate association rules between inter-transactional items
- Generate a network graph of association rules
- Type definitions provided for mypy type checker
Installation
PIP:
pip install itpminer
Conda:
conda install -c conda-forge itpminer
Example
See also demo.ipynb or Colab Notebook. The code below is available on demo.py.
# Import itpminer and create a dummy database of inter transactions
from itpminer.utils import association_rules, rules_graph
from itpminer import itp_miner
database = [
["a", "b"],
["a", "c", "d"],
["a"],
["a", "b", "c", "d"],
["a", "b", "d"],
["a", "d"]
]
# Mine frequent inter-transactional patterns
tree_dict, frequent_patterns_dict, frequent_patterns_list, frequent_patterns_dataframe = itp_miner(
database=database)
# Derive association rules from frequent patterns
rules_dict, rules_display_dict, rules_dataframe = association_rules(
tree_dict=tree_dict)
# Plot a network graph between extended items
rules_graph(rules_display_dict=rules_display_dict, rules_dict=rules_dict)
Credits
This package was created with Cookiecutter and the giswqs/pypackage project template.
References
[1] Anthony J.T. Lee, Chun-Sheng Wang, An efficient algorithm for mining frequent inter-transaction patterns, Information Sciences, Volume 177, Issue 17, 2007, Pages 3453-3476, ISSN 0020-0255, https://doi.org/10.1016/j.ins.2007.03.007. (https://www.sciencedirect.com/science/article/pii/S002002550700151X) Keywords: Association rules; Data mining; Inter-transaction patterns
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for itpminer-0.0.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2bac32b6f84de1f4ff721f24afbcb4010262f427404acfa8ffdf36896e9d31f |
|
MD5 | ae98523797368974048fe1206e4996ba |
|
BLAKE2b-256 | 8b65a4d1c87e8df4ad972f4d563b5cb1f095a3cd93c42194c884cc192e3d004d |