作者:Chonyy
### 作者邮箱:tcheon8788@gmail.com
### 首页:https://github.com/chonyy/apriori_python
### 文档:None
### 下载链接
# 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
Copy from pypi.org