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.0.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for apriori_python-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc3508b8f7feabb1380cddacf914bc028e69865829f207b3e632fefc76e4bf65 |
|
MD5 | d1851c227dc8cdd6ba2fff5d994e8c8f |
|
BLAKE2b-256 | df54148457db1189d82d44f948033a416d71f37ecfa2183f46f81407a4a3941c |