Python package to mine association rules in datasets
Project description
ruleminer
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.
- Free software: MIT/X license
- Documentation: https://ruleminer.readthedocs.io/en/latest.
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
- Willem Jan Willemse https://github.com/wjwillemse
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
Built Distribution
File details
Details for the file ruleminer-0.2.9.tar.gz
.
File metadata
- Download URL: ruleminer-0.2.9.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45850731c8b2579baca0176337c09bf172159695a8fa969c609ccfb01102b451 |
|
MD5 | ff675566a1a1b28812c2c44cd1cd3674 |
|
BLAKE2b-256 | 08942d19e319dd024a09c50d777a1f4caf3767daa6fe45f8079c8f63a3af6ebb |
File details
Details for the file ruleminer-0.2.9-py3-none-any.whl
.
File metadata
- Download URL: ruleminer-0.2.9-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87aa9728fa62f25f9f8f29ed2f441a7f76035d1728e45fe15c6bb554ee9e8f4d |
|
MD5 | 2e70809ddf43a63a350792c8d9579394 |
|
BLAKE2b-256 | 3f447c92fbfa4ffd9c085228c1b4d31e37f7810e0c7ebf88f0c1b181c48b88de |