Skip to main content

A Python package for tree-based regression and classification

Project description

Fast Adaptable and Extendable Trees for Research

adaXT is a Python module for tree-based machine-learning algorithms that is fast, adaptable and extendable. It aims to provide researchers a more flexible workflow when developing tree-based models.

It is distributed under the 3-Clause BSD license.

We encourage users and developers to report problems, request features, ask for help, or leave general comments.

Website: https://NiklasPfister.github.io/adaXT

Getting started

adaXT is available on pypi and can be installed via pip

pip install adaXT

Currently the package contains several pre-defined tree types that can be used directly for regression, classification and quantile regression. The following example illustrates how to fit a regression forest and a quantile forest:

from adaXT.random_forest import RandomForest
import numpy as np

# Create toy regression data
n = 100
X = np.random.normal(0, 1, (n, 2))
Y = X[:, 0] + np.random.normal(0, 1, n)
Xtest = np.c_[np.linspace(-1, 1, n), np.random.uniform(0, 1, n)]

# Task 1: Fit regression forest
rf = RandomForest("Regression")
rf.fit(X, Y)

# Predict on test data
Ypred = rf.predict(Xtest)

# Predict forest weight on X or Xtest
# -- can be used a similarity measure on the predictor space
weight_train = rf.predict_forest_weight()
weight_test = rf.predict_forest_weight(Xtest)

# Task 2: Fit a quantile regression
qf = RandomForest("Quantile")
qf.fit(X, Y)

# Predict 10% and 90% conditional quantile on test data
Ybdd = qf.predict(Xtest, quantile=[0.1, 0.9])

The main advantage of adaXT is however its modularity and extendability, which are discussed in more detail in the documentation.

Goals

The goal of adaXT is to provide a flexible and unified code-base for various tree-based algorithms that strikes a balance between speed and ease with which the code can be adapted and extended. It intends to provide researchers a simple toolkit for prototyping new tree-based algorithms.

adaXT aims to provide an intuitive user experience that is similar to the scikit-learn implementations of decision trees both in terms model-based syntax and hyperparameter. Under the hood, however, adaXT strikes a different balance between speed and ease of adapting and extending the code.

Adaptable and extendable

At the heart of any tree-based algorithm is a decision tree that can be fitted on data and then used to perform some version of prediction. adaXT has therefore been designed with a modular decision tree implementation that takes four input components:

  • Criteria class: Used during fitting to determine splits.

  • LeafBuilder class: Used during fitting to specify what is saved in the leaf nodes.

  • Splitter class: Used during fitting to perform the splits.

  • Prediction class: Used after fitting to make predictions.

By specifying these three components a range of different tree algorithms can be created, e.g., regression trees, classification trees, quanitle regression trees and survial trees. Additionally to this modular structure, all other operations are kept as vanilla as possible allowing users to easily change parts of the code (e.g., the splitting procedure).

Speed

As tree-based algorithms involve evaluating expensive loops over the dataset, it is important that these computations are implemented in a compiled language. adaXT implements all computationally expensive operations in Cython. This results in speeds similar (although a few factors slower) than the corresponding scikit-learn implementations. However, due to its modular structure and the avoidence of technical speed-ups adaXT is not intended to provide state-of-the-art speed and users mainly concerned with speed should consider more targeted implementations.

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

adaxt-1.2.3.tar.gz (24.9 kB view details)

Uploaded Source

Built Distributions

adaXT-1.2.3-cp312-cp312-win_amd64.whl (758.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

adaXT-1.2.3-cp312-cp312-win32.whl (646.8 kB view details)

Uploaded CPython 3.12 Windows x86

adaXT-1.2.3-cp312-cp312-musllinux_1_1_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

adaXT-1.2.3-cp312-cp312-musllinux_1_1_i686.whl (4.9 MB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

adaXT-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

adaXT-1.2.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (5.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

adaXT-1.2.3-cp312-cp312-macosx_11_0_arm64.whl (821.3 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

adaXT-1.2.3-cp311-cp311-win_amd64.whl (762.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

adaXT-1.2.3-cp311-cp311-win32.whl (650.0 kB view details)

Uploaded CPython 3.11 Windows x86

adaXT-1.2.3-cp311-cp311-musllinux_1_1_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

adaXT-1.2.3-cp311-cp311-musllinux_1_1_i686.whl (5.0 MB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

adaXT-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

adaXT-1.2.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (5.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

adaXT-1.2.3-cp311-cp311-macosx_11_0_arm64.whl (819.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

adaXT-1.2.3-cp310-cp310-win_amd64.whl (760.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

adaXT-1.2.3-cp310-cp310-win32.whl (652.6 kB view details)

Uploaded CPython 3.10 Windows x86

adaXT-1.2.3-cp310-cp310-musllinux_1_1_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

adaXT-1.2.3-cp310-cp310-musllinux_1_1_i686.whl (4.6 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

adaXT-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

adaXT-1.2.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (4.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

adaXT-1.2.3-cp310-cp310-macosx_11_0_arm64.whl (818.7 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

File details

Details for the file adaxt-1.2.3.tar.gz.

File metadata

  • Download URL: adaxt-1.2.3.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for adaxt-1.2.3.tar.gz
Algorithm Hash digest
SHA256 d625df9e2c5704506d65471b00deabee3e8c0125a5ced8ddc394bc15c2f95438
MD5 57dc86dc2e1aa0fac8ceb16f8f9fb318
BLAKE2b-256 49499fcc65a99d2424a270fe64e8c3ea3a942cdd298ea044015d7f8c585e1cec

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: adaXT-1.2.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 758.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for adaXT-1.2.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 466aa9b56079a25b4c59539c4a4f8cfeaf690ed43b4642ebea61fc1c03921f76
MD5 17ca02217ebb2243821eb5a386d453e8
BLAKE2b-256 978d18f216d3b1c245fbbfe69de56d9fbc63d3826adba64f1630620ab720ed3c

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp312-cp312-win32.whl.

File metadata

  • Download URL: adaXT-1.2.3-cp312-cp312-win32.whl
  • Upload date:
  • Size: 646.8 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for adaXT-1.2.3-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 2f0e04c7bc294f0700733bf4dfdc7430122c628b64b7a08954db10d9886f9d80
MD5 9e24a30efb564fb0b4093ebafe021281
BLAKE2b-256 b89891d5d5fbe7aeb72df57c34447a8893bdcda74695859ab1bb347f8dc88503

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 3d1dec87a3df8b4b132d7d7c4ebe8dd1e9771e71655de46471d0487b6b1486b2
MD5 f83f7d1f803260c7bf3900765aa28aa8
BLAKE2b-256 e1bca01dadb936f5c457d5eb3002042e6b2d899df1b8495c45582022c358047a

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp312-cp312-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 84c7331725774c7a89cf6a0bfee6419d8c3601cc4a6ffbb6f64d156d7b2e50ca
MD5 0a3b65c91990e28559352ac9d439cdfe
BLAKE2b-256 073b65943addc825f8ac99acda4fbc1c3100a0f81637cceb3b0cb5726cb2062e

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02dfc2f98cc592fcd7bfa951d64b167d98998798964ca27b2c7e50aa1a7c8579
MD5 46d61ea006917e96af09ba133b546acf
BLAKE2b-256 afa2597699d2abb668f9eed7271fd765fe9572290a0e30ca57394b5ac5549c90

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 93edef2ce5bf38b29bef6709e2657e4bd3cdcb9b0d6ba2a51a4096775c303fcd
MD5 80893d671d941434aad981c7ea9b2551
BLAKE2b-256 465343e82c97dc5529572b831b2898eae3ed6b96986183ad5b7f55f17d6ea8ca

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15cb9636a8cd881499faaa29557bed32a9e7bc664b11a6a2196b8a58fdf8dbcf
MD5 3d37d9297de52b6ed7f63b620d673af7
BLAKE2b-256 1eae16dd1bbf0ebdc3e3e638233e32f9a73f7e0d68eed7c48e6d1acfd8ecb2e6

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: adaXT-1.2.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 762.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for adaXT-1.2.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 81539742b1d564fffe3c0ce9bc211e474cbd2d41858928710d5ddfaa29920da3
MD5 7d9609b6a792794beb143c57835df983
BLAKE2b-256 8f3ebd059c982f1c35eb1173c22190cfe881cb4891f1dc7273573c95f851c828

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp311-cp311-win32.whl.

File metadata

  • Download URL: adaXT-1.2.3-cp311-cp311-win32.whl
  • Upload date:
  • Size: 650.0 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for adaXT-1.2.3-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 e748572b145d86c9091d7d365bffb2129d760b415438c79dcffd16287e39aa08
MD5 6348c2f2df86ca7a491d578a60cc1457
BLAKE2b-256 d5316ee820208aef8c164f5d8496f638b82a200bd1beba162c493c4085c83abf

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 6779144b50f22e268c6bdcee896cb20743e9a626b66101b37855fd415001d9e6
MD5 5e03b774fd7633f8c7cb06aea0d87f5c
BLAKE2b-256 ae04912d8311b3cc4f2d17b3bda0ca1f31e4819ff7ab001aedb444c818ec113c

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp311-cp311-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 287c8546b1bbe08c69b0467b8429979bd8f496691dea95629651e9acbaf3b462
MD5 1ef04337cf61989fc8b0208eae6a0f17
BLAKE2b-256 d0022ba3c2936ad88f4eb738535abf57964ab8606832a201124d7f738aa58166

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 97dea5a36c9a11929db6dc7e6dae53e5fd523baedd7b4c4b9b77a8d1f2f07954
MD5 2dc9e1e5813f1fef74ee1bb1b703a4c0
BLAKE2b-256 5a7e7b329b722f7f17c3efff6bfcfe2a74888e2483042a84fb6f9422f57d1afd

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 be975b248bc0a8766f7c6735af697457fb4f52afd8a35f238224545c28ef72b0
MD5 287a1585d59bd597441eb903a315f802
BLAKE2b-256 0dc930c43c7be64e9d4ac9610fd7b2dd25d823ce256b0d5f8afbb19f8cb0f07e

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b09cdad783c7bbe706028caac765626d1f300cf88eeb54efe3234bb4c0a4b55
MD5 10b1518af4815748a2da70f3fa713a7b
BLAKE2b-256 f062b201eb2143d7be33d2e9461578f72c5a7c1955aa93c2db606ada0aac14e3

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: adaXT-1.2.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 760.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for adaXT-1.2.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 239e732ee885c57911325990656d55c66c791b44c7e9c4a33f28cf708cbf85ae
MD5 b9a909cdcb2b8b406d21c2c6c9dc584c
BLAKE2b-256 60ac62dfaaeec5231999629da418202f0039dd72661ed06bb53e9ca799888611

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp310-cp310-win32.whl.

File metadata

  • Download URL: adaXT-1.2.3-cp310-cp310-win32.whl
  • Upload date:
  • Size: 652.6 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for adaXT-1.2.3-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 04e3775aa88741eab2fb41d17cfa450646edef1ff51fc4bf986b9130e46fe0a3
MD5 d89cb7a677b7ac3f251bb11acd19558b
BLAKE2b-256 373fba1a6ae20e2d79b303ce033bbe2062d1ec2355633d835b2b421f3278148f

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a891bb693498405aefb8c6cbc24923b67b4b349d743f1b5e39f94ff28c32f830
MD5 10aa76066ab74b0f8e1346528327d3c7
BLAKE2b-256 4e85e7dbd40f58c385381b7ff0ff66a2956f0924c5601af173d50bc4498a1fc5

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp310-cp310-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 a641a428047a3ea32e64a2ec3cd138d5da0865a2032bac6e4c413a1e22fbbdf4
MD5 baa80d90c4bf2d07d52d907d6a7416a0
BLAKE2b-256 00e19215e67b136c35e0c09bd7de65a6127827849c1a0228816c7d7a2de24f74

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f77cbda69c6415bf1c61c28d4cc95349d984841d412ec2b6dfc96eb6d8bc9d4
MD5 8dcd2b4afeeeaadd0f2f02995b327c41
BLAKE2b-256 b81cd4641772667d5126fcb3f6f7a65c644bc4641f16da612b60c14222e4604a

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ce8463f176707c3fdfbd8cb1bf408ddc09eb1fc1e169fdd0c91ca8cd93e84967
MD5 d65783f12e2ca9840969097b29ea5986
BLAKE2b-256 90b0193a99b8b89a0b15bc5e73ed414a76b064130bbec2c69bfe788dd024b59c

See more details on using hashes here.

File details

Details for the file adaXT-1.2.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for adaXT-1.2.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e9a69b428e2c35aeec9d7d6ef40a860d7b7568a94639ebf833865e76ccf45d0
MD5 396d7b2d73999cd151e4b0426a704dbc
BLAKE2b-256 e7dad71c67c50e9fa419e898700bd8cfc60669d349dc13604e31434773655cc2

See more details on using hashes here.

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