Skip to main content

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:

Metadata

Release files for TemporalGeneralizedRules 1.0.0

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

Source distribution (sdist)

Source distribution for TemporalGeneralizedRules 1.0.0
File Size Uploaded
TemporalGeneralizedRules-1.0.0.tar.gz 18.5 kB Details

Built distribution (wheel)

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

Total release size: 41.3 kB

Release files / TemporalGeneralizedRules-1.0.0.tar.gz

Download URL TemporalGeneralizedRules-1.0.0.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
28b6de278ea4e4d7f2b209d61027b550073f549b5df34f24c97300830b99fd7c
BLAKE2b-256 checksum
How to use checksums
82857341eabda47760ad53ca123ee38e101021a5fb55edd229a1ef4c0502cf76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Release files / TemporalGeneralizedRules-1.0.0-py3-none-any.whl

Download URL TemporalGeneralizedRules-1.0.0-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
217f867e4921a7661aa0f479e14e856d36ec2405ae01a294bd124f0559f77675
BLAKE2b-256 checksum
How to use checksums
1c337554e7edbca8ce23044e0f8b3d2a9b95b19355b627ca4288e4c4b6144c47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 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