FP-Growth
A Python implementation of the Frequent Pattern Growth algorithm.
Free software: ISC license
Documentation: https://fp-growth.readthedocs.org.
Getting Started
You can install the package with pip:
pip install pyfpgrowth
Then, to use it in a project, inport it and use the find_frequent_patterns and generate_association_rules functions:
import pyfpgrowth
It is assumed that your transactions are a sequence of sequences representing items in baskets. The item IDs are integers:
transactions = [[1, 2, 5],
[2, 4],
[2, 3],
[1, 2, 4],
[1, 3],
[2, 3],
[1, 3],
[1, 2, 3, 5],
[1, 2, 3]]
Use find_frequent_patterns to find patterns in baskets that occur over the support threshold:
patterns = pyfpgrowth.find_frequent_patterns(transactions, 2)
Use generate_association_rules to find patterns that are associated with another with a certain minimum probability:
rules = pyfpgrowth.generate_association_rules(patterns, 0.7)
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
1.0 (2016-04-25)
First release on PyPI.
Metadata
Release files for pyfpgrowth 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyfpgrowth-1.0.tar.gz | 1.6 MB | Without provenance | Details for pyfpgrowth-1.0.tar.gz |
Release files / pyfpgrowth-1.0.tar.gz
| Download URL | pyfpgrowth-1.0.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3e5780385241d90d3ae5cabcca767eb65427b0a908014d42164b3ea8899f1d0
|
|
BLAKE2b-256 checksum How to use checksums |
d24c8b7cd90b4118ff0286d6584909b99e1ca5642bdc9072fa5a8dd361c864a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyfpgrowth 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.