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.4.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for apriori_python-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70f9b6b8ae0f62883108037e3b905516cb3fcb60f9503752caba28cbe38cf628 |
|
MD5 | f50778940a7caededc301255ce8d7c40 |
|
BLAKE2b-256 | 3494fc3bacb14e6e5c63d24c5a90132185d63c08479cd27a61a0e22dd2b7ed77 |