Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyfpgrowth

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyfpgrowth

A Python implementation of the Frequent Pattern Growth algorithm.

  • 1.0
  • PyPI
  • Socket score

Maintainers
1

=============================== FP-Growth

.. image:: https://img.shields.io/pypi/v/pyfpgrowth.svg :target: https://pypi.python.org/pypi/pyfpgrowth

.. image:: https://img.shields.io/travis/evandempsey/fp-growth.svg :target: https://travis-ci.org/evandempsey/fp-growth

.. image:: https://readthedocs.org/projects/fp-growth/badge/?version=latest :target: https://readthedocs.org/projects/fp-growth/?badge=latest :alt: Documentation Status

A Python implementation of the Frequent Pattern Growth algorithm.

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.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage

======= History

1.0 (2016-04-25)

  • First release on PyPI.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc