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 details)
Built Distribution
File details
Details for the file apriori_python-1.0.4.tar.gz
.
File metadata
- Download URL: apriori_python-1.0.4.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2942515a135a9b8b7f1ce2f43b1ccc6384421d5f232b40814456a085e96820b |
|
MD5 | 2a3d91b2a57aaa9bae373c30cfadf3a3 |
|
BLAKE2b-256 | 4806c024915133b5ed59910a725ac740cd37c9ac99fd5da65a5bb3e4173261cf |
File details
Details for the file apriori_python-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: apriori_python-1.0.4-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70f9b6b8ae0f62883108037e3b905516cb3fcb60f9503752caba28cbe38cf628 |
|
MD5 | f50778940a7caededc301255ce8d7c40 |
|
BLAKE2b-256 | 3494fc3bacb14e6e5c63d24c5a90132185d63c08479cd27a61a0e22dd2b7ed77 |