Skip to main content

Python package to mine association rules in datasets

Project description

ruleminer

Documentation image image License: MIT Ruff

Python package to discover association rules in Pandas DataFrames.

This package implements the code of the paper Discovering and ranking validation rules in supervisory data.

Features

Here is what the package does:

  • Generate human-readable validation rules using rule templates containing regular expressions and a Pandas DataFrame dataset

    • available functions: min, max, abs, quantile, sum, substr, split, count, sumif and countif
    • including parameters for metric filters and rule precisions (including XBRL tolerances)
  • Evaluate rules and calculate association rules metrics

    • available metrics: abs support, abs exceptions, confidence, support, added value, casual confidence, casual support, conviction, lift and rule power factor

Here are some examples of rule templates with regexes with which you can generate validation rules:

  • if ({"Type"} == ".") then ({"."} > 0)

  • if ({"."} > 0) then (({"."} == 0) & ({"."} > 0))*

  • (({"."} + {"."} + {"."}) == {"."})

  • ({"Own funds"} <= quantile({"Own funds"}, 0.95))

  • (substr({"Type"}, 0, 1) in ["a", "b"])

The first template generates (with the dataset described in the Usage section) rules like

  • if ({"Type"} == "non-life_insurer") then ({"TP-nonlife"} > 0)
  • if ({"Type"} == "life_insurer") then ({"TP-life"} > 0)

These generated validation rules can then be used to validate new datasets.

Contributors

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

ruleminer-1.0.3.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

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

ruleminer-1.0.3-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file ruleminer-1.0.3.tar.gz.

File metadata

  • Download URL: ruleminer-1.0.3.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for ruleminer-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c6b64e1a8b8817117b6f936e372e889037bb0cd228121d3c7d0aebc2714e1187
MD5 1ed97bda1710b48b9ac86aa10d6873ae
BLAKE2b-256 889434e78814fb18bacfa6a6c238dd3b94563b8531e99f8be405b5e2d7401f4b

See more details on using hashes here.

File details

Details for the file ruleminer-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: ruleminer-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for ruleminer-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 87cba897abebd22a17f1c7c705e431da8688478046ba29185052e31dbbb61e6c
MD5 045b90ca1910689b3ea876116fd763a8
BLAKE2b-256 1e21d87bc5a9c52c73c3373ad80fd87ec2f61d87b5e9e6ead853c97866c5b961

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