Implements the various versions of Ripple Down Rules (RDR) for knowledge representation and reasoning.
Project description
Ripple Down Rules (RDR)
A python implementation of the various ripple down rules versions, including Single Classification (SCRDR), Multi Classification (MCRDR), and Generalised Ripple Down Rules (GRDR).
SCRDR, MCRDR, and GRDR are rule-based classifiers that are built incrementally, and can be used to classify data cases. The rules are refined as new data cases are classified.
SCRDR, MCRDR, and GRDR implementation were inspired from the book: "Ripple Down Rules: An Alternative to Machine Learning" by Paul Compton, Byeong Ho Kang.
Installation
sudo apt-get install graphviz graphviz-dev
pip install ripple_down_rules
Example Usage
Fit the SCRDR to the data, then classify one of the data cases to check if its correct, and render the tree to a file:
from ripple_down_rules.datastructures import CaseQuery
from ripple_down_rules.rdr import SingleClassRDR
from ripple_down_rules.datasets import load_zoo_dataset
from ripple_down_rules.utils import render_tree
all_cases, targets = load_zoo_dataset()
scrdr = SingleClassRDR()
# Fit the SCRDR to the data
case_queries = [CaseQuery(case, target=target) for case, target in zip(all_cases, targets)]
scrdr.fit(case_queries, animate_tree=True)
# Render the tree to a file
render_tree(scrdr.start_rule, use_dot_exporter=True, filename="scrdr")
cat = scrdr.fit_case(all_cases[50], targets[50])
assert cat == targets[50]
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ripple_down_rules-0.0.5.tar.gz.
File metadata
- Download URL: ripple_down_rules-0.0.5.tar.gz
- Upload date:
- Size: 71.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dc219994c9c77751a05e566e15703b3548dee93598aaabc727441ce8f7ca984
|
|
| MD5 |
32e843d218e762f1ec7431a863194f2d
|
|
| BLAKE2b-256 |
15de0947348c645e91a88af137ec5c9ecd2f9a33126c213fb6a60b9ebb249155
|
Provenance
The following attestation bundles were made for ripple_down_rules-0.0.5.tar.gz:
Publisher:
publish-to-test-pypi.yml on AbdelrhmanBassiouny/ripple_down_rules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ripple_down_rules-0.0.5.tar.gz -
Subject digest:
2dc219994c9c77751a05e566e15703b3548dee93598aaabc727441ce8f7ca984 - Sigstore transparency entry: 188144316
- Sigstore integration time:
-
Permalink:
AbdelrhmanBassiouny/ripple_down_rules@2fc9586d272ea971328f3fc291641438bd143c5f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AbdelrhmanBassiouny
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@2fc9586d272ea971328f3fc291641438bd143c5f -
Trigger Event:
push
-
Statement type:
File details
Details for the file ripple_down_rules-0.0.5-py3-none-any.whl.
File metadata
- Download URL: ripple_down_rules-0.0.5-py3-none-any.whl
- Upload date:
- Size: 59.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4ec802535142cbf69158076c6f8e4307a1b026dc7ce580f0ad492e14308988e
|
|
| MD5 |
c55fa4c4bbd81664e3545e17d120a47a
|
|
| BLAKE2b-256 |
a6e32ac62a291950a8b28f7b097458cc8c6dc8ecf2266d449ab78b91be910c6a
|
Provenance
The following attestation bundles were made for ripple_down_rules-0.0.5-py3-none-any.whl:
Publisher:
publish-to-test-pypi.yml on AbdelrhmanBassiouny/ripple_down_rules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ripple_down_rules-0.0.5-py3-none-any.whl -
Subject digest:
c4ec802535142cbf69158076c6f8e4307a1b026dc7ce580f0ad492e14308988e - Sigstore transparency entry: 188144320
- Sigstore integration time:
-
Permalink:
AbdelrhmanBassiouny/ripple_down_rules@2fc9586d272ea971328f3fc291641438bd143c5f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AbdelrhmanBassiouny
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@2fc9586d272ea971328f3fc291641438bd143c5f -
Trigger Event:
push
-
Statement type: