Skip to main content

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


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 details)

Uploaded Source

Built Distribution

fpgrowth_py-1.0.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file fpgrowth_py-1.0.0.tar.gz.

File metadata

  • Download URL: fpgrowth_py-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 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

Hashes for fpgrowth_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 79bd9e963f034c9e3c4db8bc111280cfd92d87df74a60f3f28f47ba729e8689e
MD5 6c8f804a1692466ca3fe4ac64f27ac74
BLAKE2b-256 784b9ba2c8866128219ab17eeb3ac0df0c5998cd139f1be2933adc91a8642d7b

See more details on using hashes here.

File details

Details for the file fpgrowth_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fpgrowth_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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

Hashes for fpgrowth_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57da89c5568ab52d1b5e0dfa028b31981525f6356848a5bb8ddc6dd504e4fffb
MD5 1dd10e4d56556dc8c2e7bc8ca7755682
BLAKE2b-256 1851e0cc561ab4a1079c1fad85a43bfa1a95fbe1f4f27c866d12b4d79f95b1ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page