https://github.com/balaka-18/apriorib1
apriorib1 is a Python library that applies the very famous unsupervised learning algorithm, apriori, for Association Rule Mining(ARM) on a dataset of transaction/purchase logs and shows the accepted association rules.
https://github.com/balaka-18/apriorib1
apriori association-rule-mining association-rules grocery-store unsupervised-learning
Last synced: 4 months ago
JSON representation
apriorib1 is a Python library that applies the very famous unsupervised learning algorithm, apriori, for Association Rule Mining(ARM) on a dataset of transaction/purchase logs and shows the accepted association rules.
- Host: GitHub
- URL: https://github.com/balaka-18/apriorib1
- Owner: BALaka-18
- License: mit
- Created: 2020-08-19T12:44:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T12:54:52.000Z (about 5 years ago)
- Last Synced: 2025-06-06T23:08:46.642Z (5 months ago)
- Topics: apriori, association-rule-mining, association-rules, grocery-store, unsupervised-learning
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# apriorib1
apriorib1 is a Python library that applies the very famous unsupervised learning algorithm, apriori, for Association Rule Mining(ARM) on a dataset of transaction/purchase logs and shows the accepted association rules.
Currently, this version is limited to a maximum of 4 items in a certain transaction.

## New in this version
1. Displays stage-wise final itemset as pandas DataFrames.

## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install apriorib1.
```bash
pip install apriorib1
```## Quick Start
```python
from apriorib1 import Aprioridata = [['MILK', 'BREAD', 'BISCUIT'],
['BREAD', 'MILK', 'BISCUIT', 'CORNFLAKES'],
['BREAD', 'TEA', 'BOURNVITA'],
['JAM', 'MAGGI', 'BREAD', 'MILK'],
['MAGGI', 'TEA', 'BISCUIT'],
['BREAD', 'TEA', 'BOURNVITA'],
['MAGGI', 'TEA', 'CORNFLAKES'],
['MAGGI', 'BREAD', 'TEA', 'BISCUIT'],
['JAM', 'MAGGI', 'BREAD', 'TEA'],
['BREAD', 'MILK'],
['COFFEE', 'COCK', 'BISCUIT', 'CORNFLAKES'],
['COFFEE', 'COCK', 'BISCUIT', 'CORNFLAKES'],
['COFFEE', 'SUGER', 'BOURNVITA'],
['BREAD', 'COFFEE', 'COCK'],
['BREAD', 'SUGER', 'BISCUIT'],
['COFFEE', 'SUGER', 'CORNFLAKES'],
['BREAD', 'SUGER', 'BOURNVITA'],
['BREAD', 'COFFEE', 'SUGER'],
['BREAD', 'COFFEE', 'SUGER'],
['TEA', 'MILK', 'COFFEE', 'CORNFLAKES']]# Testing the Apriori class
apr = Apriori(records=data,min_sup=2,min_conf=50)
df1,df2,df3,df4 = apr.show_as_df(stage=1),apr.show_as_df(stage=2),apr.show_as_df(stage=3),apr.show_as_df(stage=4)
print("VIEWING THE ITEMSET DATAFRAMES AT THE DIFFERENT STAGES :\nSTAGE 1\n{}\nSTAGE 2\n{}\nSTAGE 3\n{}\nSTAGE 4\n{}".format(df1,df2,df3,df4))
apr.checkAssc()
```## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)