Need help with fp-growth?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

113 Stars 50 Forks ISC License 24 Commits 23 Opened issues


Python implementation of the Frequent Pattern Growth algorithm

Services available


Need anything else?

Contributors list

# 60,020
24 commits



.. image:: :target:

.. image:: :target:

.. image:: :target: :alt: Documentation Status

.. image:: :target:

A Python implementation of the Frequent Pattern Growth algorithm.

  • Free software: ISC license
  • Documentation:

Getting Started

You can install the package with pip::

pip install pyfpgrowth

Then, to use it in a project, inport it and use the findfrequentpatterns and generateassociationrules 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 findfrequentpatterns to find patterns in baskets that occur over the support threshold::

patterns = pyfpgrowth.find_frequent_patterns(transactions, 2)

Use generateassociationrules to find patterns that are associated with another with a certain minimum probability::

rules = pyfpgrowth.generate_association_rules(patterns, 0.7)


This package was created with Cookiecutter_ and the

_ project template.

.. _Cookiecutter: .. _


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.