https://github.com/chonyy/fpgrowth_py
🔨 Python implementation of FP Growth algorithm, new and simple!
https://github.com/chonyy/fpgrowth_py
data-mining fp-growth fpgrowth machine-learning python
Last synced: 5 months ago
JSON representation
🔨 Python implementation of FP Growth algorithm, new and simple!
- Host: GitHub
- URL: https://github.com/chonyy/fpgrowth_py
- Owner: chonyy
- License: mit
- Created: 2020-10-25T19:00:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-02T09:05:02.000Z (over 3 years ago)
- Last Synced: 2024-04-26T13:43:30.766Z (about 2 years ago)
- Topics: data-mining, fp-growth, fpgrowth, machine-learning, python
- Language: Python
- Homepage: https://towardsdatascience.com/fp-growth-frequent-pattern-generation-in-data-mining-with-python-implementation-244e561ab1c3
- Size: 4.22 MB
- Stars: 80
- Watchers: 6
- Forks: 29
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## How to use
### Install the Pypi package using pip
```
pip install fpgrowth_py
```
Then use it like
```python
from fpgrowth_py import fpgrowth
itemSetList = [['eggs', 'bacon', 'soup'],
['eggs', 'bacon', 'apple'],
['soup', 'bacon', 'banana']]
freqItemSet, rules = fpgrowth(itemSetList, minSupRatio=0.5, minConf=0.5)
print(freqItemSet)
print(rules)
# [[{'beer'}, {'rice'}, 0.6666666666666666], [{'rice'}, {'beer'}, 1.0]]
# rules[0] --> rules[1], confidence = rules[2]
```
### Clone the repo
Get a copy of this repo using git clone
```
git clone https://github.com/chonyy/fpgrowth_py.git
```
Run the program with dataset provided and **default** values for *minSupport* = 0.5 and *minConfidence* = 0.5
```
python fpgrowth.py -f dataset.csv
```
Run program with dataset and min support and min confidence
```
python fpgrowth.py -f tesco2.csv -s 0.5 -c 0.5
```