Skip to main content

apriorib1

apriorib1 is a Python library that applies the very famous unsupervised learning algorithm, apriori, for Association Rule Mining(ARM) on a dataset of transaction/purchase logs and shows the accepted association rules.

Currently, this version is limited to a maximum of 4 items in a certain transaction.

Demo

New in this version

  1. Displays stage-wise final itemset as pandas DataFrames.

Demo 2

Installation

Use the package manager pip to install apriorib1.

pip install apriorib1

Quick Start

from apriorib1 import Apriori

data = [['MILK', 'BREAD', 'BISCUIT'],
    ['BREAD', 'MILK', 'BISCUIT', 'CORNFLAKES'],
    ['BREAD', 'TEA', 'BOURNVITA'],
    ['JAM', 'MAGGI', 'BREAD', 'MILK'],
    ['MAGGI', 'TEA', 'BISCUIT'],
    ['BREAD', 'TEA', 'BOURNVITA'],
    ['MAGGI', 'TEA', 'CORNFLAKES'],
    ['MAGGI', 'BREAD', 'TEA', 'BISCUIT'],
    ['JAM', 'MAGGI', 'BREAD', 'TEA'],
    ['BREAD', 'MILK'],
    ['COFFEE', 'COCK', 'BISCUIT', 'CORNFLAKES'],
    ['COFFEE', 'COCK', 'BISCUIT', 'CORNFLAKES'],
    ['COFFEE', 'SUGER', 'BOURNVITA'],
    ['BREAD', 'COFFEE', 'COCK'],
    ['BREAD', 'SUGER', 'BISCUIT'],
    ['COFFEE', 'SUGER', 'CORNFLAKES'],
    ['BREAD', 'SUGER', 'BOURNVITA'],
    ['BREAD', 'COFFEE', 'SUGER'],
    ['BREAD', 'COFFEE', 'SUGER'],
    ['TEA', 'MILK', 'COFFEE', 'CORNFLAKES']]

# Testing the Apriori class
apr = Apriori(records=data,min_sup=2,min_conf=50)
df1,df2,df3,df4 = apr.show_as_df(stage=1),apr.show_as_df(stage=2),apr.show_as_df(stage=3),apr.show_as_df(stage=4)
print("VIEWING THE ITEMSET DATAFRAMES AT THE DIFFERENT STAGES :\nSTAGE 1\n{}\nSTAGE 2\n{}\nSTAGE 3\n{}\nSTAGE 4\n{}".format(df1,df2,df3,df4))
apr.checkAssc()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for apriorib1 1.0.2

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

Source distribution (sdist)

Source distribution for apriorib1 1.0.2
File Size Uploaded
apriorib1-1.0.2.tar.gz 4.1 kB Details

Built distribution (wheel)

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

Total release size: 9.9 kB

Release files / apriorib1-1.0.2.tar.gz

Download URL apriorib1-1.0.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4b036fa04dcfa67525dadec8e6e3ba89b947ae44359ff23e82075d47cdaf42a2
BLAKE2b-256 checksum
How to use checksums
1d81901dc87f4b456605d393824aa3646ce9e4fd4c2314afc9f3b877e7d83d3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / apriorib1-1.0.2-py3-none-any.whl

Download URL apriorib1-1.0.2-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8f8a29fdcf680abe83f551b25ece71ae38213fca7c08cb49054f8a3a40dfffe
BLAKE2b-256 checksum
How to use checksums
c2cb998d95eeeb98795f703c6e9ccf13788109731ae8a93c6813bbec89900de2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

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