Skip to main content

Modern decision trees in Python

Project description

Code style: black CircleCI Main Checked with mypy codecov PyPI Download count Latest PyPI release DOI

treeple

treeple is a scikit-learn compatible API for building state-of-the-art decision trees. These include unsupervised trees, oblique trees, uncertainty trees, quantile trees and causal trees.

Tree-models have withstood the test of time, and are consistently used for modern-day data science and machine learning applications. They especially perform well when there are limited samples for a problem and are flexible learners that can be applied to a wide variety of different settings, such as tabular, images, time-series, genomics, EEG data and more.

Note that this package was originally named scikit-tree but was renamed to treeple after version 0.8.0. version <0.8.0 is still available at https://pypi.org/project/scikit-tree/.

Documentation

See here for the documentation for our dev version: https://docs.neurodata.io/treeple/dev/index.html

Is treeple useful for me?

  1. If you use decision tree models (random forest, extra trees, isolation forests, etc.) in your work, treeple is a good package to try out. We have a variety of better tree models that are not available in scikit-learn, and we are always looking for new tree models to implement. For example, oblique decision trees are in general better than their axis-aligned counterparts.

  2. If you are interested in extending the decision tree API in scikit-learn, treeple is a good package to try out. We have a variety of internal APIs that are not available in scikit-learn, and are able to support new decision tree models easier.

Why oblique trees and why trees beyond those in scikit-learn?

In 2001, Leo Breiman proposed two types of Random Forests. One was known as Forest-RI, which is the axis-aligned traditional random forest. One was known as Forest-RC, which is the random oblique linear combinations random forest. This leveraged random combinations of features to perform splits. MORF builds upon Forest-RC by proposing additional functions to combine features. Other modern tree variants such as Canonical Correlation Forests (CCF), Extended Isolation Forests, Quantile Forests, or unsupervised random forests are also important at solving real-world problems using robust decision tree models.

Installation

Our installation will try to follow scikit-learn installation as close as possible, as we contain Cython code subclassed, or inspired by the scikit-learn tree submodule.

Dependencies

We minimally require:

* Python (>=3.9)
* numpy
* scipy
* scikit-learn

Installation with Pip (https://pypi.org/project/treeple/)

Installing with pip on a conda environment is the recommended route.

pip install treeple

Development

We welcome contributions for modern tree-based algorithms. We use Cython to achieve fast C/C++ speeds, while abiding by a scikit-learn compatible (tested) API. We also will welcome contributions in C/C++ if they improve the extensibility, or runtime performance of the codebase. Our Cython internals are easily extensible because they follow the internal Cython API of scikit-learn as well.

Due to the current state of scikit-learn's internal Cython code for trees, we have to instead leverage a fork of scikit-learn at https://github.com/neurodata/scikit-learn when extending the decision tree model API of scikit-learn. Specifically, we extend the Python and Cython API of the tree submodule in scikit-learn in our submodule, so we can introduce the tree models housed in this package. Thus these extend the functionality of decision-tree based models in a way that is not possible yet in scikit-learn itself. As one example, we introduce an abstract API to allow users to implement their own oblique splits. Our plan in the future is to benchmark these functionalities and introduce them upstream to scikit-learn where applicable and inclusion criterion are met.

References

[1]: Li, Adam, et al. "Manifold Oblique Random Forests: Towards Closing the Gap on Convolutional Deep Networks" SIAM Journal on Mathematics of Data Science, 5(1), 77-96, 2023

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

treeple-0.10.3.tar.gz (9.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

treeple-0.10.3-cp312-cp312-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.12Windows x86-64

treeple-0.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

treeple-0.10.3-cp312-cp312-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

treeple-0.10.3-cp312-cp312-macosx_10_13_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

treeple-0.10.3-cp311-cp311-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.11Windows x86-64

treeple-0.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

treeple-0.10.3-cp311-cp311-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

treeple-0.10.3-cp311-cp311-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

treeple-0.10.3-cp310-cp310-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.10Windows x86-64

treeple-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

treeple-0.10.3-cp310-cp310-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

treeple-0.10.3-cp310-cp310-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

treeple-0.10.3-cp39-cp39-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.9Windows x86-64

treeple-0.10.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

treeple-0.10.3-cp39-cp39-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

treeple-0.10.3-cp39-cp39-macosx_10_9_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file treeple-0.10.3.tar.gz.

File metadata

  • Download URL: treeple-0.10.3.tar.gz
  • Upload date:
  • Size: 9.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.16

File hashes

Hashes for treeple-0.10.3.tar.gz
Algorithm Hash digest
SHA256 3b7e9ab303dd5c9309db2447f7a73b31aeeff7eef6db600121c4684fa72f2558
MD5 00b61a3f8c1ead05d66b7b8eb98c9efd
BLAKE2b-256 11ebf430b734b49751cd65de939c5336be67f851e5af4c86c5202bdbfeb021d5

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: treeple-0.10.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.16

File hashes

Hashes for treeple-0.10.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6990afaed088bfe509202b6edaad10b01d7331fc7ccd93a5eff6c32135edcb8c
MD5 7a25450dfafd5f158c3a4e0008c68c5b
BLAKE2b-256 8069e7d74a573aeb784a085f334c5409cbc1d19729e8edf170ecb08c70fa68ed

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 caac7ac972bb4579998ed27cf980dca4083f850d177b8a73d1571b51964885cd
MD5 29f06a2010911de748d44ee142cf5d25
BLAKE2b-256 991e40f769745620e946cbb76609148e415a8cec5ec8952293c5f3cc36e4a09a

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b9cc95247a200dd7a0333ae69e78a7e3aecfdbabd57305235a434103be05c7b4
MD5 0d01016180b3af11232e37a9977ea9d4
BLAKE2b-256 823d8088c694cdc7f9cb3fb37fe0f81c9be75e839057cb4ffbe6224f8b3ce117

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 dcb4d143952554496fc28bbaebac8b8b1c05a6326ca1d30de41da256d1c8eb9e
MD5 ca071f29ff62c66e0f9e12516e77ce5b
BLAKE2b-256 4737aecb4ad5b0c20a7307269146ad8a76a90e814fd69c3f5c39e6a1785c14e6

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: treeple-0.10.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.16

File hashes

Hashes for treeple-0.10.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 31aaeb71f1e2d74eeb24c5b3963b450cdb6cd3596fb81281161ffdca6aeed18e
MD5 d79f8fe9daa027adba8499d345c9b2dd
BLAKE2b-256 5508587e4a6771a5380377be9b58fe5136dc0b6bd21a260fe7ff4180796a6510

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c23d904edf2874c3fff9bfdfb778d0a558cbd587c7e4e201581fad87cb4102be
MD5 772f764745b6a1426f571506195abddc
BLAKE2b-256 c247632eba88c2c750f07918a831167347cd908d208c809a4550523e95904aca

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df0538b587bef257347b9ca6d9bd60fe6526041bdb5219d4247d10a83f2fb3db
MD5 b8b0ce3ada25a24b1c735a384e3388d7
BLAKE2b-256 10f7fad2c634ab55319c7fe56466c7247f756b046ee1a11a23674db58f1f8754

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 71152487cea3b4d49aa29d291e0c0b596f37648c10b2cb74f54379e17a0e0209
MD5 5e1c2fb4ab24a944a1327406c36ac8e0
BLAKE2b-256 5edb3830b2e369bb2c30452ace1f6310bb09b28292047508bb89f7efb9138653

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: treeple-0.10.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.16

File hashes

Hashes for treeple-0.10.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e7cf98a08fcb21222cd5063d2919a82d8b653d8e73bc281423982c873cdd01bd
MD5 5258e194020709f05159e898a3d7748c
BLAKE2b-256 1b0e619670ca4a1a7c05002ca1f53f39f9beda0bab0e64396321a862b372a05c

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb875e674e8ccb4def93d6e9ca0d01e78d8677ad670f7f54958f888b767eb265
MD5 164d6205acedf184abc4ecaa08b2e9a4
BLAKE2b-256 2f79c285d07fef2c668044f2e23d6089a0aa04ef7273d0fe5fd6b2824a934695

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 36da98499481226ad356521cc6f337b90857f3a4f481a55eb1c7a5dff6309690
MD5 bdc7824066c7af5e461e73fce1d5de3c
BLAKE2b-256 48c9d551fc3d70832d12a0afbec6e122cd638aab9beacc43afa2c77a21e17df9

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cec15ae4262bb5ee475f2a8c902757c0efcd846923c8e2df519de2e31c20c92c
MD5 e481dc20291ccc7e3bc246e0c54e751a
BLAKE2b-256 fac37527e23d439e8323a8dd42b270fe94af0d0420ff8b8ac7655a86b6f32e31

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: treeple-0.10.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.16

File hashes

Hashes for treeple-0.10.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 735e4ce1eb11ff51f2f791a0ccf920b5866b758a7b889256e261957a85765186
MD5 bce88cf98de3c96bbf0de70084fc14b2
BLAKE2b-256 46793234d4e61d3af2548f8acd77d5e30e6645c7b6c4f9784369d3ed8afc2996

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa881516dd84c0112c14b258dd99b357fc8fd3dbb6f4c65960cf6e3f40e57dea
MD5 b55d30a14862e0d45f1d75f65ec54d09
BLAKE2b-256 0e060af4e85c02a3644801767b1eabc38874e2dfd87481326800a8ed4a4863e5

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a13c9591c554b7775120d8a08cf206b6e955be4992eed930615cfdb6749f6107
MD5 af396fc6ebe09d420eb53a32c70353c3
BLAKE2b-256 a0f27408bedc20fa9276c4c16ae20d7c5da76c846844a06310ea37e4f7b4ad19

See more details on using hashes here.

File details

Details for the file treeple-0.10.3-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for treeple-0.10.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 43a070579896af0cdf47f4aa21830ebbf5d67bb4c052cf31b0c0a045bf0d6198
MD5 a344834c31049a8fc14b810aab6a9fd3
BLAKE2b-256 40cb253369438ec0cc77d7f1c5c1c2c1fc007fb0aefbcfc4bde9b7a2e7bd3c74

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