ripple-down-rules 0.5.3__py3-none-any.whl → 0.5.5__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/__init__.py +1 -1
- ripple_down_rules/user_interface/template_file_creator.py +1 -0
- ripple_down_rules/utils.py +2 -2
- {ripple_down_rules-0.5.3.dist-info → ripple_down_rules-0.5.5.dist-info}/METADATA +20 -3
- {ripple_down_rules-0.5.3.dist-info → ripple_down_rules-0.5.5.dist-info}/RECORD +8 -8
- {ripple_down_rules-0.5.3.dist-info → ripple_down_rules-0.5.5.dist-info}/WHEEL +1 -1
- {ripple_down_rules-0.5.3.dist-info → ripple_down_rules-0.5.5.dist-info}/licenses/LICENSE +0 -0
- {ripple_down_rules-0.5.3.dist-info → ripple_down_rules-0.5.5.dist-info}/top_level.txt +0 -0
ripple_down_rules/__init__.py
CHANGED
@@ -300,6 +300,7 @@ class TemplateFileCreator:
|
|
300
300
|
if isinstance(node, ast.FunctionDef) and node.name == func_name:
|
301
301
|
exec_globals = {}
|
302
302
|
scope = extract_imports(tree=tree)
|
303
|
+
updates.update(scope)
|
303
304
|
exec(source, scope, exec_globals)
|
304
305
|
user_function = exec_globals[func_name]
|
305
306
|
updates[func_name] = user_function
|
ripple_down_rules/utils.py
CHANGED
@@ -1370,8 +1370,8 @@ def draw_tree(root: Node, fig: Figure):
|
|
1370
1370
|
"""
|
1371
1371
|
Draw the tree using matplotlib and networkx.
|
1372
1372
|
"""
|
1373
|
-
if matplotlib.get_backend().lower() not in ['qt5agg', 'qt4agg', 'qt6agg']:
|
1374
|
-
|
1373
|
+
# if matplotlib.get_backend().lower() not in ['qt5agg', 'qt4agg', 'qt6agg']:
|
1374
|
+
# matplotlib.use("Qt6Agg") # or "Qt6Agg", depending on availability
|
1375
1375
|
|
1376
1376
|
if root is None:
|
1377
1377
|
return
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.5
|
4
4
|
Summary: Implements the various versions of Ripple Down Rules (RDR) for knowledge representation and reasoning.
|
5
5
|
Author-email: Abdelrhman Bassiouny <abassiou@uni-bremen.de>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -693,7 +693,7 @@ Requires-Dist: colorama
|
|
693
693
|
Requires-Dist: pygments
|
694
694
|
Requires-Dist: sqlalchemy
|
695
695
|
Requires-Dist: pandas
|
696
|
-
Requires-Dist: pyparsing
|
696
|
+
Requires-Dist: pyparsing>=3.2.3
|
697
697
|
Provides-Extra: viz
|
698
698
|
Requires-Dist: networkx>=3.1; extra == "viz"
|
699
699
|
Requires-Dist: matplotlib>=3.7.5; extra == "viz"
|
@@ -725,6 +725,10 @@ For GUI support, also install:
|
|
725
725
|
sudo apt-get install libxcb-cursor-dev
|
726
726
|
```
|
727
727
|
|
728
|
+
## Documentation
|
729
|
+
|
730
|
+
Read the documentation [here](https://abdelrhmanbassiouny.github.io/ripple_down_rules/).
|
731
|
+
|
728
732
|
## Example Usage
|
729
733
|
|
730
734
|
### Propositional Example
|
@@ -795,6 +799,19 @@ cat = grdr.classify(all_cases[50])['species']
|
|
795
799
|
assert cat == targets[50]
|
796
800
|
```
|
797
801
|
|
802
|
+
When prompted to write a rule, I wrote the following inside the template function that the Ripple Down Rules created:
|
803
|
+
```python
|
804
|
+
return case.milk == 1
|
805
|
+
```
|
806
|
+
then
|
807
|
+
```python
|
808
|
+
return case.aquatic == 1
|
809
|
+
```
|
810
|
+
|
811
|
+
The rule tree generated from fitting all the dataset will look like this:
|
812
|
+

|
813
|
+
|
814
|
+
|
798
815
|
### Relational Example
|
799
816
|
|
800
817
|
By relational, I mean that each rule conclusion is not a constant value, but is related to the case being classified,
|
@@ -887,6 +904,6 @@ try that yourself and see if it works!
|
|
887
904
|
author = {Bassiouny, Abdelrhman},
|
888
905
|
title = {Ripple-Down-Rules},
|
889
906
|
url = {https://github.com/AbdelrhmanBassiouny/ripple_down_rules},
|
890
|
-
version = {0.5.
|
907
|
+
version = {0.5.4},
|
891
908
|
}
|
892
909
|
```
|
@@ -1,11 +1,11 @@
|
|
1
|
-
ripple_down_rules/__init__.py,sha256=
|
1
|
+
ripple_down_rules/__init__.py,sha256=OV_GxE_svT43w1V5gHpc0YaGCqmA-cm_U7P8UmX4Ox4,99
|
2
2
|
ripple_down_rules/experts.py,sha256=rPRJU2py5wCopZADVWOP3Vzp077KL6ArDlkxUQ0Mh6w,12130
|
3
3
|
ripple_down_rules/helpers.py,sha256=TvTJU0BA3dPcAyzvZFvAu7jZqsp8Lu0HAAwvuizlGjg,2018
|
4
4
|
ripple_down_rules/rdr.py,sha256=FJYuRXgpUYSSK1pYrp2yeXb_ZZ2xjPED31tzxofokL4,48865
|
5
5
|
ripple_down_rules/rdr_decorators.py,sha256=pYCKLgMKgQ6x_252WQtF2t4ZNjWPBxnaWtJ6TpGdcc0,7820
|
6
6
|
ripple_down_rules/rules.py,sha256=TPNVMqW9T-_46BS4WemrspLg5uG8kP6tsPvWWBAzJxg,17515
|
7
7
|
ripple_down_rules/start-code-server.sh,sha256=otClk7VmDgBOX2TS_cjws6K0UwvgAUJhoA0ugkPCLqQ,949
|
8
|
-
ripple_down_rules/utils.py,sha256=
|
8
|
+
ripple_down_rules/utils.py,sha256=4xQ5gmIeMsY-mA9g-4cedKt2WJq4oZAMs5XEKeplWPM,51127
|
9
9
|
ripple_down_rules/datastructures/__init__.py,sha256=V2aNgf5C96Y5-IGghra3n9uiefpoIm_QdT7cc_C8cxQ,111
|
10
10
|
ripple_down_rules/datastructures/callable_expression.py,sha256=D2KD1RdShzxYZPAERgywZ5ZPE4ar8WmMtXINqvYo_Tc,12497
|
11
11
|
ripple_down_rules/datastructures/case.py,sha256=r8kjL9xP_wk84ThXusspgPMrAoed2bGQmKi54fzhmH8,15258
|
@@ -16,9 +16,9 @@ ripple_down_rules/user_interface/gui.py,sha256=SB0gUhgReJ3yx-NEHRPMGVuNRLPRUwW8-
|
|
16
16
|
ripple_down_rules/user_interface/ipython_custom_shell.py,sha256=24MIFwqnAhC6ofObEO6x5xRWRnyQmPpPmTvxbCKBrzM,6514
|
17
17
|
ripple_down_rules/user_interface/object_diagram.py,sha256=tsB6iuLNEbHxp5lR2WjyejjWbnAX_nHF9xS8jNPOQVk,4548
|
18
18
|
ripple_down_rules/user_interface/prompt.py,sha256=AkkltdDIaioN43lkRKDPKSjJcmdSSGZDMYz7AL7X9lE,8082
|
19
|
-
ripple_down_rules/user_interface/template_file_creator.py,sha256=
|
20
|
-
ripple_down_rules-0.5.
|
21
|
-
ripple_down_rules-0.5.
|
22
|
-
ripple_down_rules-0.5.
|
23
|
-
ripple_down_rules-0.5.
|
24
|
-
ripple_down_rules-0.5.
|
19
|
+
ripple_down_rules/user_interface/template_file_creator.py,sha256=FGtLfYBfr4310c7Dfa9b2qiOWLNzHk1q3kdhD70Ilg4,13804
|
20
|
+
ripple_down_rules-0.5.5.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
21
|
+
ripple_down_rules-0.5.5.dist-info/METADATA,sha256=irk6Cn48hjgyNiE9XyuRsSFP1svBynaDMTkN1ijbvRc,48188
|
22
|
+
ripple_down_rules-0.5.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
ripple_down_rules-0.5.5.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
|
24
|
+
ripple_down_rules-0.5.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|