woodtapper 0.0.6__tar.gz
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.
- woodtapper-0.0.6/LICENSE +21 -0
- woodtapper-0.0.6/MANIFEST.in +3 -0
- woodtapper-0.0.6/PKG-INFO +102 -0
- woodtapper-0.0.6/README.md +70 -0
- woodtapper-0.0.6/pyproject.toml +45 -0
- woodtapper-0.0.6/realkd/__init__.py +1 -0
- woodtapper-0.0.6/realkd/boosting.py +519 -0
- woodtapper-0.0.6/realkd/datasets.py +124 -0
- woodtapper-0.0.6/realkd/evaluation.py +55 -0
- woodtapper-0.0.6/realkd/legacy.py +301 -0
- woodtapper-0.0.6/realkd/logic.py +251 -0
- woodtapper-0.0.6/realkd/patch.py +79 -0
- woodtapper-0.0.6/realkd/rules.py +1055 -0
- woodtapper-0.0.6/realkd/search.py +820 -0
- woodtapper-0.0.6/realkd/subgroups.py +149 -0
- woodtapper-0.0.6/setup.cfg +4 -0
- woodtapper-0.0.6/setup.py +29 -0
- woodtapper-0.0.6/tests/test_integration_extractor.py +27 -0
- woodtapper-0.0.6/tests/test_unit_extractor.py +56 -0
- woodtapper-0.0.6/tests/test_utils.py +38 -0
- woodtapper-0.0.6/woodtapper/__init__.py +1 -0
- woodtapper-0.0.6/woodtapper/example_sampling/__init__.py +12 -0
- woodtapper-0.0.6/woodtapper/example_sampling/explanation.py +152 -0
- woodtapper-0.0.6/woodtapper/example_sampling/utils/__init__.py +0 -0
- woodtapper-0.0.6/woodtapper/example_sampling/utils/utils.py +24 -0
- woodtapper-0.0.6/woodtapper/example_sampling/utils/weights.c +30477 -0
- woodtapper-0.0.6/woodtapper/example_sampling/utils/weights.pyx +43 -0
- woodtapper-0.0.6/woodtapper/extract_rules/Splitter/_QuantileSplitter.c +35093 -0
- woodtapper-0.0.6/woodtapper/extract_rules/Splitter/_QuantileSplitter.pyx +364 -0
- woodtapper-0.0.6/woodtapper/extract_rules/Splitter/__init__.py +0 -0
- woodtapper-0.0.6/woodtapper/extract_rules/__init__.py +16 -0
- woodtapper-0.0.6/woodtapper/extract_rules/b_extractors.py +391 -0
- woodtapper-0.0.6/woodtapper/extract_rules/bagging.py +282 -0
- woodtapper-0.0.6/woodtapper/extract_rules/base.py +865 -0
- woodtapper-0.0.6/woodtapper/extract_rules/causal.py +168 -0
- woodtapper-0.0.6/woodtapper/extract_rules/extractors.py +805 -0
- woodtapper-0.0.6/woodtapper/extract_rules/utils.py +208 -0
- woodtapper-0.0.6/woodtapper/extract_rules/visualization.py +183 -0
- woodtapper-0.0.6/woodtapper.egg-info/PKG-INFO +102 -0
- woodtapper-0.0.6/woodtapper.egg-info/SOURCES.txt +41 -0
- woodtapper-0.0.6/woodtapper.egg-info/dependency_links.txt +1 -0
- woodtapper-0.0.6/woodtapper.egg-info/requires.txt +15 -0
- woodtapper-0.0.6/woodtapper.egg-info/top_level.txt +2 -0
woodtapper-0.0.6/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 artefactory
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: woodtapper
|
|
3
|
+
Version: 0.0.6
|
|
4
|
+
Summary: A Python toolbox for interpretable and explainable tree ensembles.
|
|
5
|
+
Author: Abdoulaye SAKHO
|
|
6
|
+
Author-email: Abdoulaye SAKHO <abdoulaye7020@gmail.com>, artefactory <abdoulaye.sakho@artefact.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/artefactory/woodtapper
|
|
9
|
+
Project-URL: Repository, https://github.com/artefactory/woodtapper
|
|
10
|
+
Keywords: woodtapper,interpretable ML,tree-based models,Cython
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
13
|
+
Classifier: Topic :: Software Development
|
|
14
|
+
Requires-Python: <3.13,>=3.12
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: numpy>=2.3.1
|
|
18
|
+
Requires-Dist: pandas>=2.3.0
|
|
19
|
+
Requires-Dist: scikit-learn>=1.6.1
|
|
20
|
+
Requires-Dist: matplotlib>=3.10.0
|
|
21
|
+
Requires-Dist: ucimlrepo>=0.0.7
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8.4.2; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pre-commit>=4.3.0; extra == "dev"
|
|
26
|
+
Provides-Extra: docs
|
|
27
|
+
Requires-Dist: mkdocs>=1.6.1; extra == "docs"
|
|
28
|
+
Requires-Dist: mkdocs-material>=9.6.22; extra == "docs"
|
|
29
|
+
Requires-Dist: mkdocstrings-python>=1.18.2; extra == "docs"
|
|
30
|
+
Dynamic: author
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
<div align="center">
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<picture>
|
|
37
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos/logo_woodpecker_compressed.png">
|
|
38
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos/logo_woodpecker_compressed_light.png" >
|
|
39
|
+
<img src="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos/logo_woodpecker_compressed_light.png" width="300">
|
|
40
|
+
|
|
41
|
+
</picture>
|
|
42
|
+
|
|
43
|
+
*User-friendly and scalable Python package for tapping decision tree ensembles*
|
|
44
|
+
|
|
45
|
+
[](https://github.com/astral-sh/ruff)
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
WoodTapper is a Python toolbox for interpretable and explainable tree ensembles learning, fully compatible with the scikit-learn API. WoodTapper enables seamless integration of interpretable rule extraction into existing machine learning workflows. In addition, it introduces an example-based explanation module that links predictions to a small set of representative samples.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## 🌳 Installation
|
|
52
|
+
|
|
53
|
+
**From TestPypi**:
|
|
54
|
+
```bash
|
|
55
|
+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ woodtapper
|
|
56
|
+
```
|
|
57
|
+
**From Source:**
|
|
58
|
+
Clone the repository:
|
|
59
|
+
```bash
|
|
60
|
+
git clone git@github.com:artefactory/mgs-grf.git
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
And install the required packages into your environment (conda, mamba or pip):
|
|
64
|
+
```bash
|
|
65
|
+
pip install -r requirements.txt
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then run the following command from the repository root directory :
|
|
69
|
+
```
|
|
70
|
+
pip install -e .[dev]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 🚀 How to use WoodTapper
|
|
74
|
+
```python
|
|
75
|
+
## RandomForestClassifier rules extraction
|
|
76
|
+
from extract_rules.extractors import SirusClassifier
|
|
77
|
+
|
|
78
|
+
SIRUS = SirusClassifier(n_estimators=1000,max_depth=2,
|
|
79
|
+
quantile=10,p0=0.01, random_state=0)
|
|
80
|
+
SIRUS.fit(X_train,y_train)
|
|
81
|
+
y_pred_sirus = SIRUS.predict(X_test)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 🙏 Acknowledgements
|
|
85
|
+
|
|
86
|
+
This work was done through a partenership between **Artefact Research Center** and the **Laboratoire de Probabilités Statistiques et Modélisation** (LPSM) of Sorbonne University.
|
|
87
|
+
|
|
88
|
+
<p align="center">
|
|
89
|
+
<a href="https://www.artefact.com/data-consulting-transformation/artefact-research-center/">
|
|
90
|
+
<img src="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos/logo_arc.png" height="80" />
|
|
91
|
+
</a>
|
|
92
|
+
 
|
|
93
|
+
 
|
|
94
|
+
<a href="https://www.lpsm.paris/">
|
|
95
|
+
<img src="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos//logo_LPSM.jpg" height="95" />
|
|
96
|
+
</a>
|
|
97
|
+
</p>
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
## 📜 Citation
|
|
101
|
+
|
|
102
|
+
If you find the code usefull, please consider citing us :
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<picture>
|
|
5
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos/logo_woodpecker_compressed.png">
|
|
6
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos/logo_woodpecker_compressed_light.png" >
|
|
7
|
+
<img src="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos/logo_woodpecker_compressed_light.png" width="300">
|
|
8
|
+
|
|
9
|
+
</picture>
|
|
10
|
+
|
|
11
|
+
*User-friendly and scalable Python package for tapping decision tree ensembles*
|
|
12
|
+
|
|
13
|
+
[](https://github.com/astral-sh/ruff)
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
WoodTapper is a Python toolbox for interpretable and explainable tree ensembles learning, fully compatible with the scikit-learn API. WoodTapper enables seamless integration of interpretable rule extraction into existing machine learning workflows. In addition, it introduces an example-based explanation module that links predictions to a small set of representative samples.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## 🌳 Installation
|
|
20
|
+
|
|
21
|
+
**From TestPypi**:
|
|
22
|
+
```bash
|
|
23
|
+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ woodtapper
|
|
24
|
+
```
|
|
25
|
+
**From Source:**
|
|
26
|
+
Clone the repository:
|
|
27
|
+
```bash
|
|
28
|
+
git clone git@github.com:artefactory/mgs-grf.git
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
And install the required packages into your environment (conda, mamba or pip):
|
|
32
|
+
```bash
|
|
33
|
+
pip install -r requirements.txt
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then run the following command from the repository root directory :
|
|
37
|
+
```
|
|
38
|
+
pip install -e .[dev]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 🚀 How to use WoodTapper
|
|
42
|
+
```python
|
|
43
|
+
## RandomForestClassifier rules extraction
|
|
44
|
+
from extract_rules.extractors import SirusClassifier
|
|
45
|
+
|
|
46
|
+
SIRUS = SirusClassifier(n_estimators=1000,max_depth=2,
|
|
47
|
+
quantile=10,p0=0.01, random_state=0)
|
|
48
|
+
SIRUS.fit(X_train,y_train)
|
|
49
|
+
y_pred_sirus = SIRUS.predict(X_test)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 🙏 Acknowledgements
|
|
53
|
+
|
|
54
|
+
This work was done through a partenership between **Artefact Research Center** and the **Laboratoire de Probabilités Statistiques et Modélisation** (LPSM) of Sorbonne University.
|
|
55
|
+
|
|
56
|
+
<p align="center">
|
|
57
|
+
<a href="https://www.artefact.com/data-consulting-transformation/artefact-research-center/">
|
|
58
|
+
<img src="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos/logo_arc.png" height="80" />
|
|
59
|
+
</a>
|
|
60
|
+
 
|
|
61
|
+
 
|
|
62
|
+
<a href="https://www.lpsm.paris/">
|
|
63
|
+
<img src="https://raw.githubusercontent.com/artefactory/woodtapper/main/data/logos//logo_LPSM.jpg" height="95" />
|
|
64
|
+
</a>
|
|
65
|
+
</p>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## 📜 Citation
|
|
69
|
+
|
|
70
|
+
If you find the code usefull, please consider citing us :
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=78.1.1", "wheel", "Cython>=3.1.2","numpy>=2.3.1","scikit-learn>=1.6.1" ]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "woodtapper"
|
|
7
|
+
authors = [
|
|
8
|
+
{name = "Abdoulaye SAKHO", email = "abdoulaye7020@gmail.com"},
|
|
9
|
+
{name = "artefactory", email = "abdoulaye.sakho@artefact.com"},
|
|
10
|
+
]
|
|
11
|
+
version = "0.0.6"
|
|
12
|
+
description = "A Python toolbox for interpretable and explainable tree ensembles."
|
|
13
|
+
readme = "README.md"
|
|
14
|
+
license = "MIT"
|
|
15
|
+
keywords = ["woodtapper", "interpretable ML", "tree-based models", "Cython"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Programming Language :: Python :: 3.12",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Mathematics",
|
|
19
|
+
"Topic :: Software Development"
|
|
20
|
+
]
|
|
21
|
+
requires-python = ">=3.12,<3.13"
|
|
22
|
+
dependencies = [
|
|
23
|
+
"numpy>=2.3.1",
|
|
24
|
+
"pandas>=2.3.0",
|
|
25
|
+
"scikit-learn>=1.6.1",
|
|
26
|
+
"matplotlib>=3.10.0",
|
|
27
|
+
"ucimlrepo>=0.0.7",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
"Homepage" = "https://github.com/artefactory/woodtapper"
|
|
32
|
+
"Repository" = "https://github.com/artefactory/woodtapper"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
dev = [
|
|
37
|
+
"pytest>=8.4.2",
|
|
38
|
+
"pytest-cov>=7.0.0",
|
|
39
|
+
"pre-commit>=4.3.0"
|
|
40
|
+
]
|
|
41
|
+
docs = [
|
|
42
|
+
"mkdocs>=1.6.1",
|
|
43
|
+
"mkdocs-material>=9.6.22",
|
|
44
|
+
"mkdocstrings-python>=1.18.2"
|
|
45
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|