ripple-down-rules 0.0.3__py3-none-any.whl → 0.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ripple_down_rules-0.0.4.dist-info/METADATA +730 -0
- {ripple_down_rules-0.0.3.dist-info → ripple_down_rules-0.0.4.dist-info}/RECORD +5 -4
- ripple_down_rules-0.0.4.dist-info/licenses/LICENSE +674 -0
- ripple_down_rules-0.0.3.dist-info/METADATA +0 -54
- {ripple_down_rules-0.0.3.dist-info → ripple_down_rules-0.0.4.dist-info}/WHEEL +0 -0
- {ripple_down_rules-0.0.3.dist-info → ripple_down_rules-0.0.4.dist-info}/top_level.txt +0 -0
@@ -1,54 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: ripple_down_rules
|
3
|
-
Version: 0.0.3
|
4
|
-
Summary: Implements the various versions of Ripple Down Rules (RDR) for knowledge representation and reasoning.
|
5
|
-
Author-email: Abdelrhman Bassiouny <abassiou@uni-bremen.de>
|
6
|
-
Project-URL: Homepage, https://github.com/AbdelrhmanBassiouny/ripple_down_rules
|
7
|
-
Keywords: robotics,knowledge,reasoning,representation
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
9
|
-
Requires-Python: >=3.8
|
10
|
-
Description-Content-Type: text/markdown
|
11
|
-
|
12
|
-
# Ripple Down Rules (RDR)
|
13
|
-
|
14
|
-
A python implementation of the various ripple down rules versions, including Single Classification (SCRDR),
|
15
|
-
Multi Classification (MCRDR), and Generalised Ripple Down Rules (GRDR).
|
16
|
-
|
17
|
-
SCRDR, MCRDR, and GRDR are rule-based classifiers that are built incrementally, and can be used to classify
|
18
|
-
data cases. The rules are refined as new data cases are classified.
|
19
|
-
|
20
|
-
SCRDR, MCRDR, and GRDR implementation were inspired from the book:
|
21
|
-
["Ripple Down Rules: An Alternative to Machine Learning"](https://doi.org/10.1201/9781003126157) by Paul Compton, Byeong Ho Kang.
|
22
|
-
|
23
|
-
## Installation
|
24
|
-
|
25
|
-
```bash
|
26
|
-
sudo apt-get install graphviz graphviz-dev
|
27
|
-
pip install ripple_down_rules
|
28
|
-
```
|
29
|
-
|
30
|
-
## Example Usage
|
31
|
-
|
32
|
-
Fit the SCRDR to the data, then classify one of the data cases to check if its correct,
|
33
|
-
and render the tree to a file:
|
34
|
-
|
35
|
-
```Python
|
36
|
-
from ripple_down_rules.datastructures import CaseQuery
|
37
|
-
from ripple_down_rules.rdr import SingleClassRDR
|
38
|
-
from ripple_down_rules.datasets import load_zoo_dataset
|
39
|
-
from ripple_down_rules.utils import render_tree
|
40
|
-
|
41
|
-
all_cases, targets = load_zoo_dataset()
|
42
|
-
|
43
|
-
scrdr = SingleClassRDR()
|
44
|
-
|
45
|
-
# Fit the SCRDR to the data
|
46
|
-
case_queries = [CaseQuery(case, target=target) for case, target in zip(all_cases, targets)]
|
47
|
-
scrdr.fit(case_queries, animate_tree=True)
|
48
|
-
|
49
|
-
# Render the tree to a file
|
50
|
-
render_tree(scrdr.start_rule, use_dot_exporter=True, filename="scrdr")
|
51
|
-
|
52
|
-
cat = scrdr.fit_case(all_cases[50], targets[50])
|
53
|
-
assert cat == targets[50]
|
54
|
-
```
|
File without changes
|
File without changes
|