Skip to main content

Algorithms for association Rule mining

Project description

Temporal Generalized Association Rules

This library provides four algorithms related to Association Rule mining. The algorithms are:

  • vertical_apriori
  • vertical_cumulate
  • htar
  • htgar

These algorithms use a transactional dataset that is transformed to a vertical format for optimization. Dataset MUST follow the following format:

order_id product_name
1 Bread
1 Milk
2 Bread
2 Beer
3 Eggs

Or if timestamps are provided:

order_id timestamp product_name
1 852087600 Bread
1 852087600 Milk
2 854420400 Bread
2 854420400 Beer
3 854420400 Eggs

Each field is separated by ","

TGAR

This is the main class that must be instantiated once.

Usage

import TemporalGeneralizedRules

tgar = TemporalGeneralizedRules.TGAR()

Vertical Apriori

This algorithm has four parameters:

  • filepath: Filepath of the dataset in csv format with the format discussed in the previous section.
  • min_supp: Minimum support threshold.
  • min_conf: Minimum confidence threshold.
  • parallel_count: Optional parameter that enables parallelization in candidate count phase of the algorithm.

Usage

tgar.apriori("dataset.csv", 0.05, 0.5)

Vertical Cumulate

This algorithm has five parameters:

  • filepath: Filepath of the dataset in csv format with the format discussed in the previous section.
  • min_supp: Minimum support threshold.
  • min_conf: Minimum confidence threshold.
  • min_r: Minimum R-interesting threshold.
  • parallel_count: Optional parameter that enables parallelization in candidate count phase of the algorithm. It can make execution faster.

Usage

tgar.vertical_cumulate("dataset.csv", 0.05, 0.5, 1.1)

HTAR

This algorithm has four parameters:

  • filepath: Filepath of the dataset in csv format with the format discussed in the previous section.
  • min_supp: Minimum support threshold.
  • min_conf: Minimum confidence threshold.
  • parallel_count: Optional parameter that enables parallelization in candidate count phase of the algorithm. It can make execution faster.

Usage

tgar.htar("dataset.csv", 0.05, 0.5)

HTGAR

This algorithm has five parameters:

  • filepath: Filepath of the dataset in csv format with the format discussed in the previous section.
  • min_supp: Minimum support threshold.
  • min_conf: Minimum confidence threshold.
  • min_r: Minimum R-interesting threshold.
  • parallel_count: Optional parameter that enables parallelization in candidate count phase of the algorithm. It can make execution faster.

Usage

tgar.htgar("dataset.csv", 0.05, 0.5, 1.1)

Pypy

For a better performance we recommend using this package with Pypy, a faster implementation of python.

https://www.pypy.org/

Bibliography

The following were based on the following papers:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TemporalGeneralizedRules-1.0.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TemporalGeneralizedRules-1.0.1-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file TemporalGeneralizedRules-1.0.1.tar.gz.

File metadata

  • Download URL: TemporalGeneralizedRules-1.0.1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.2

File hashes

Hashes for TemporalGeneralizedRules-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a6e7c78ef0230108eb8f3dfaa5e3323b580c0eb8f8a1b6d2d06ecf62dff47b3c
MD5 519cab42cc8071f2ba703f244eb1a99c
BLAKE2b-256 2eef8ca8dc70adadc5aeddabee8df4629ceb3ed2eb861d93ba7246891d696777

See more details on using hashes here.

File details

Details for the file TemporalGeneralizedRules-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for TemporalGeneralizedRules-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4865dda32d4bf55c12e3426fb8ad63a1e3f26a91fd31a73dca7233dc0d38ec56
MD5 ea303086abdaaae42f5f701293d7a1ae
BLAKE2b-256 de0cb7f4d29b675dcd3227476631706d4b22e95b74c46a048a4f9becc1df9fcd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page