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.8.tar.gz (358.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: woodtapper-0.0.8.tar.gz
  • Upload date:
  • Size: 358.7 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.8.tar.gz
Algorithm Hash digest
SHA256 2dbb00ba94d601e5823b132ac2b6b3ca82e65e32c90afe20183b154f91e2ed06
MD5 aa26b2ce2b190e3784f2e66349ada32c
BLAKE2b-256 a5232d8147c21e9c59914972935171b66bb30f41959720b67b3311ab8ae8b52c

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