Python implementation of FP Growth algorithm
Project description
How to use
Install the Pypi package using pip
pip install fpgrowth_py
Then use it like
from fpgrowth_py import fpgrowth
itemSetList = [['eggs', 'bacon', 'soup'],
['eggs', 'bacon', 'apple'],
['soup', 'bacon', 'banana']]
freqItemSet, rules = fpgrowth(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
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 dataset.csv -s 0.33 -c 0.77
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fpgrowth_py-1.0.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for fpgrowth_py-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57da89c5568ab52d1b5e0dfa028b31981525f6356848a5bb8ddc6dd504e4fffb |
|
MD5 | 1dd10e4d56556dc8c2e7bc8ca7755682 |
|
BLAKE2b-256 | 1851e0cc561ab4a1079c1fad85a43bfa1a95fbe1f4f27c866d12b4d79f95b1ac |