Skip to main content

A Python toolbox for interpretable and explainable tree ensembles.

Project description

User-friendly and scalable Python package for tapping decision tree ensembles

CI Status Linting , formatting, imports sorting: ruff Pre-commit Docs

License Python Versions PyPI Version

WoodTapper is a Python toolbox for interpretable and explainable tree ensembles learning, fully compatible with the scikit-learn API.

🪵 Key Features

  • Rule extraction from tree-based ensembles.
  • Example-based explanation module that links predictions to a small set of representative samples.

🛠 Installation

From PyPi:

pip install woodtapper

🌿 WoodTapper RulesExtraction module

## RandomForestClassifier rules extraction
from woodtapper.extract_rules import SirusClassifier

SIRUS = SirusClassifier(n_estimators=1000,max_depth=2,
                          quantile=10,p0=0.01, random_state=0)
SIRUS.fit(X_train,y_train)
y_pred_sirus = SIRUS.predict(X_test)

🌱 WoodTapper ExampleExplanation module

## RandomForestClassifier rules extraction
from woodtapper.example_sampling import RandomForestClassifierExplained

RFExplained = RandomForestClassifierExplained(n_estimators=100)
RFExplained.fit(X_train,y_train)
example_explanation = RFExplained.explanation(X_test) # Get the 5 most similar samples for each test sample

🙏 Acknowledgements

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.

   

📜 Citation

If you find the code usefull, please consider citing us :

@misc{woodtapper,
  title        = {WoodTapper: a Python package for tapping decision tree ensembles},
  author       = {Sakho, Abdoulaye and AOUAD, Jad and Malherbe, Emmanuel and Scornet, Erwan},
  year         = {2025},
  howpublished = {\url{https://github.com/artefactory/woodtapper}},
}

For SIRUS methodology, consider citing:

@article{benard2021sirus,
  title={Sirus: Stable and interpretable rule set for classification},
  author={Benard, Clement and Biau, Gerard and Da Veiga, Sebastien and Scornet, Erwan},
  year={2021}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

woodtapper-0.0.10.tar.gz (358.6 kB view details)

Uploaded Source

File details

Details for the file woodtapper-0.0.10.tar.gz.

File metadata

  • Download URL: woodtapper-0.0.10.tar.gz
  • Upload date:
  • Size: 358.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for woodtapper-0.0.10.tar.gz
Algorithm Hash digest
SHA256 31d5b9050d9a493f64150547256f9d805e6f6b39702504dbc641c7bbbcb5f84b
MD5 c201fc351e7a0672b8fe9c5a9c45658c
BLAKE2b-256 4bb216eb51caa9e191b42c2925af78faadb915cb69e169c444bc7d6154975bc4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page