Skip to main content

A package for tree-based statistical estimation and inference using optimal decision trees.

Project description

ODTlearn Logo

A package for tree-based statistical estimation and inference using optimal decision trees. ODTlearn provides implementations of StrongTrees [1], FairTrees [2], RobustTrees [3] for classification, and Prescriptive Trees [4] for prescription.

License

Documentation

The package documentation contains usage examples and method reference.

Installation

The current development version can be installed from source with the following command:

pip install git+https://github.com/D3M-Research-Group/odtlearn.git#egg=odtlearn

A release version of the package will be available on PyPI shortly.

Obtain Gurobi License

To use Gurobi with ODTlearn, you must have a valid Gurobi License. Free licenses are available for academic use and additional methods for obtaining a Gurobi license can be found here.

CBC Binaries

Python-MIP provides CBC binaries for 64-bit versions of Windows, Linux, and MacOS that run on Intel hardware, however we have observed that these binaries do not seem to work properly with lazy constraint generation, which is used in some of our MIO formulations. Thus, to ensure expected behavior when using ODTlearn, we strongly recommend building CBC from source. Below are the steps needed to compile CBC from source using coinbrew.

mkdir CBC
cd CBC
wget -nH https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew
chmod u+x coinbrew 
bash coinbrew fetch Cbc@master --no-prompt
bash coinbrew build Cbc@stable/2.10

export DYLD_LIBRARY_PATH=/PATH/TO/CBC/dist/lib
export PMIP_CBC_LIBRARY=/PATH/TO/CBC/dist/lib/PLATFORM_SPECIFIC_SHARED_LIB

The last two steps are critical for ensuring that ODTlearn (through Python-MIP) uses the correct CBC binary. For Windows and MacOS the shared library name is libCbc.dll and libCbc.dylib, respectively. For Linux, the shared library name is libCbcSolver.so. To ensure that the environment variables persist, we suggest adding the last two lines to your .zshrc or .bashrc file.

Developing

This project uses black to format code and flake8 for linting. We also support pre-commit to ensure these have been run. To configure your local environment please install these development dependencies and set up the commit hooks.

pip install black flake8 pre-commit
pre-commit install

References

  • [1] Aghaei, S., Gómez, A., & Vayanos, P. (2021). Strong optimal classification trees. arXiv preprint arXiv:2103.15965. https://arxiv.org/abs/2103.15965.
  • [2] Jo, N., Aghaei, S., Benson, J., Gómez, A., & Vayanos, P. (2022). Learning optimal fair classification trees. arXiv preprint arXiv:2201.09932. https://arxiv.org/pdf/2201.09932.pdf
  • [3] Justin, N., Aghaei, S., Gomez, A., & Vayanos, P. (2021). Optimal Robust Classification Trees. In The AAAI-22 Workshop on Adversarial Machine Learning and Beyond. https://openreview.net/pdf?id=HbasA9ysA3
  • [4] Jo, N., Aghaei, S., Gómez, A., & Vayanos, P. (2021). Learning optimal prescriptive trees from observational data. arXiv preprint arXiv:2108.13628. https://arxiv.org/pdf/2108.13628.pdf

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

odtlearn-1.0.0.tar.gz (88.9 kB view details)

Uploaded Source

Built Distribution

odtlearn-1.0.0-py3-none-any.whl (108.9 kB view details)

Uploaded Python 3

File details

Details for the file odtlearn-1.0.0.tar.gz.

File metadata

  • Download URL: odtlearn-1.0.0.tar.gz
  • Upload date:
  • Size: 88.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for odtlearn-1.0.0.tar.gz
Algorithm Hash digest
SHA256 321c3f6a6fbcf834717f5d0c958a181882bfcf5d7e658c9251b2a1eb0daef67b
MD5 a8352683032e35affaf0218f0a35319d
BLAKE2b-256 612db7a9237d4af78f63e9c7ecdc8f964e0aed7e41a49b01c14abf5427d4a546

See more details on using hashes here.

Provenance

File details

Details for the file odtlearn-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: odtlearn-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 108.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for odtlearn-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d21597dab4d6d0945e03d8061d759ccda51e90c4acd6d247909c0d33a671f1ff
MD5 82598628762d21a2ccf3ef1ca16e7105
BLAKE2b-256 bace682e1bf8e29adf0719a18af515abe0d9037a212c00e62cf8d408434fc2a4

See more details on using hashes here.

Provenance

Supported by

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