A simple apriori algorithm python implementation
Project description
Apriori Algorithm Python Implementation
How to use
Install the Pypi package using pip
pip install apriori_python
Then use it like
from apriori_python import apriori
itemSetList = [['eggs', 'bacon', 'soup'],
['eggs', 'bacon', 'apple'],
['soup', 'bacon', 'banana']]
freqItemSet, rules = apriori(itemSetList, minSup=0.5, minConf=0.5)
print(rules)
# [[{'beer'}, {'rice'}, 0.6666666666666666], [{'rice'}, {'beer'}, 1.0]]
# rules[0] --> rules[1], confidence = rules[2]
Clone the repo
To run the program with dataset provided and default values for minSupport = 0.5 and minConfidence = 0.5
python apriori.py -f dataset.csv
To run program with dataset and min support and min confidence
python apriori.py -f dataset.csv -s 0.17 -c 0.68
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
apriori_python-1.0.1.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for apriori_python-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8906733a45c0830f4cff5119349ed9f2598021ea2a28debc7c0bdc15ea49df4e |
|
MD5 | 66a5691a688e0c59855e76f47055b7d3 |
|
BLAKE2b-256 | 7ae53b70578e957191c6495949662b3850e3562c9d2a178bd61ca00b9a231b8e |