Skip to main content

FIMProject - Frequent Itemset Algorithms and Frequent Sequence Mining Algorithms in Python

PyPI Downloads Downloads Downloads

Installation

FIMProject requires Python 3.7 or newer, and the easiest way to install it is via pip:

pip install FIMProject

Simple Example

from FIM import apriori
from FIM import association_rules
from FIM.utils import TransactionEncoder


# The apriori function expects data in a one-hot encoded pandas DataFrame.
# Suppose we have the following transaction data:
data = [['onion', 'beer', 'crisps', 'beef'],
        ['beer', 'tomato', 'crisps', 'eggs'],
        ['onion', 'crisps', 'eggs'],
        ['beer', 'eggs', 'beef'],
        ['onion', 'beer', 'carrot', 'crisps'],
        ['onion', 'eggs', 'beef'],
        ['onion', 'beer', 'carrot', 'crisps', 'eggs', 'beef'],
        ['onion', 'beer', 'crisps', 'eggs'],
        ['beer', 'tomato', 'carrot', 'eggs'],
        ['onion', 'crisps', 'eggs', 'beef'],
        ['beer', 'carrot', 'crisps', 'eggs']]

# We can transform it into the right format via the TransactionEncoder as follows:
te = TransactionEncoder()
df = te.fit_transform(data, set_pandas=True)

# Now, let us return the items and itemsets with at least 30% support:
freq_items = apriori(df, min_support=0.3)
# Now, let us return the association rules with freq_items df:
rules = association_rules(freq_items, metric="confidince", min_threshold=0.7)

What is df?

df is a pandas dataframe. It is a table of transactions. Each row is a transaction and each column is an item. The value of each cell is the number of items in the transaction.

Metadata

Release files for fimproject 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fimproject 0.0.7
File Size Uploaded Provenance Actions
fimproject-0.0.7.tar.gz 9.9 kB Without provenance Details for fimproject-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fimproject 0.0.7
File Interpreter ABI Platform Actions
fimproject-0.0.7-py3-none-any.whl Python 3 none any Details for fimproject-0.0.7-py3-none-any.whl

Total release size: 22.3 kB

Release files / fimproject-0.0.7.tar.gz

Download URL fimproject-0.0.7.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f1d4b783b4678fad5c7f75d8e5d17c7f5637aa18c23cf96e69bcf44cd4636c37
BLAKE2b-256 checksum
How to use checksums
b762885fece4be06a0cbfbb56d9a7a9e35bedf11d29f4512cd65c5a434209cb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / fimproject-0.0.7-py3-none-any.whl

Download URL fimproject-0.0.7-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
107d34edc36c82412053dd32df33c92fc5abf2be296723d5919f717afb10ab32
BLAKE2b-256 checksum
How to use checksums
ce5b0f324732e3bf085a793a0b6df0be795423a28b70bb27e81cc8c0b27d76c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Security for fimproject 0.0.7

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page