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
Built Distributions
File details
Details for the file adaxt-1.2.2.tar.gz
.
File metadata
- Download URL: adaxt-1.2.2.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3fe9b9a559ca92e4208206c513d71907c933e378b134f223bd52ff62ec3c839 |
|
MD5 | 85b6f8ac3507e034a095e33625275016 |
|
BLAKE2b-256 | e450efd4684b5e51c9f2ccd0b949ce0af36c36c85d26970a58cd3a05818416a1 |
File details
Details for the file adaXT-1.2.2-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 637.4 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cc5e006d2c4cfbd8b90a040eb4dcf082c6662b5930a9715f6aff1ce33f138a9 |
|
MD5 | 44147cdd14edaa8e15bc9700fb36011a |
|
BLAKE2b-256 | 1e26c51a2d8e431284c3f4f9e4ff75749ea8347003241db1b418a93becfca9a1 |
File details
Details for the file adaXT-1.2.2-cp312-cp312-win32.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp312-cp312-win32.whl
- Upload date:
- Size: 537.2 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4063f474758edfc631b674e4baf13049af5a6512484720080cbf7204aa4d5476 |
|
MD5 | cb4da5e607d3ac5c5d6a8b9001f7b56d |
|
BLAKE2b-256 | fd10ffb4f0f224e64b659f1f7a76bd5c8c72ccf395a53c715b76d4432874fab6 |
File details
Details for the file adaXT-1.2.2-cp312-cp312-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp312-cp312-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.12, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1af4829aedbcb329deaaf24569089471197d02c0a3fe7597de1887eae7e44f87 |
|
MD5 | 4978a79e9f808117f852fc55e21d0432 |
|
BLAKE2b-256 | 1f6bca8d94b126f8e020649b2f361223b72468349a9aa42f10a5309948d42372 |
File details
Details for the file adaXT-1.2.2-cp312-cp312-musllinux_1_1_i686.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp312-cp312-musllinux_1_1_i686.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.12, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf1f1b2a5b5217fad69c73fb36f416ca4dde8694b546f207be47b6c27a42384b |
|
MD5 | 6210feb24154971242c8b49a81a8e63f |
|
BLAKE2b-256 | e9583f15f9d60b44c3ce96fb190a69e29e27c71f564f436282ab93570295b242 |
File details
Details for the file adaXT-1.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c722790620ec1aa8c57883dc04fdcf42caf8eb25c116125f1170cf23b57461fe |
|
MD5 | e72f0e73f281e647865083ade98aa47e |
|
BLAKE2b-256 | eef05fe3e1ba67b54b49d070504eea45017a33aa30f9cf02c3693c3c61fc9696 |
File details
Details for the file adaXT-1.2.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddc013711f05ece6229d989bcf6db68025417602ca71ad89d5c7537cea546389 |
|
MD5 | 0a7a1fe782b37c7d2bfb61fd331fd186 |
|
BLAKE2b-256 | 660a43c4502d40183750dc345c87183356df68a8a918eb4a74876d0b4ba65263 |
File details
Details for the file adaXT-1.2.2-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 686.6 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c9dcf61eea64a7838feede26e6a0c53d6e439c1b3ce52f81d88ce94e7586586 |
|
MD5 | 6ac5cbfa348cc3b9cf51ac22f19e00b3 |
|
BLAKE2b-256 | fd9bb3b0d6f2830d2bd3648642f7c3f3850d386e3eacd047220c62018efa7dad |
File details
Details for the file adaXT-1.2.2-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 637.9 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29002938a9c71d83879d3325d7e51aa9627ea861e07f1c041f8c96456f449fc5 |
|
MD5 | 365c523b33ca8e1673c814c278699602 |
|
BLAKE2b-256 | b1a570c351aa15dc7383afdbcfcd19ca413dd885c7b78e337099b7938b0bbbe9 |
File details
Details for the file adaXT-1.2.2-cp311-cp311-win32.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp311-cp311-win32.whl
- Upload date:
- Size: 537.5 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 372f99ad52366bcabbf363b6eec3ba0237feec8209d2a4f7927329359a0fc252 |
|
MD5 | c29f30caac4ec5b1cadb0662b5e90ad8 |
|
BLAKE2b-256 | 54e743de38d64a875c69b570d4c835d20c1bcf73b4d8308306837f57966abb26 |
File details
Details for the file adaXT-1.2.2-cp311-cp311-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp311-cp311-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.11, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac9f7af2a6f04c6b3fdbf8ac6a673b7bb751ac5855f9471927ea6199ecbce77a |
|
MD5 | 64a78efca682c005951d45c50d5ebee3 |
|
BLAKE2b-256 | 364ab9871eb8f9759157303cc0480aeb97a884e2551bba9833f0b1884f6a1dd1 |
File details
Details for the file adaXT-1.2.2-cp311-cp311-musllinux_1_1_i686.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp311-cp311-musllinux_1_1_i686.whl
- Upload date:
- Size: 4.1 MB
- Tags: CPython 3.11, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0addf5d9472923297e2c83f86887b2cdd0bbda0be0a4c6441fb75fec1ab62b2a |
|
MD5 | f96b14cfbe8b24c2d65efe6e885791cb |
|
BLAKE2b-256 | 42b5b5162cbf2c0295943083e90e66cf782fe6d45922273ec29fe62bff2e8b3b |
File details
Details for the file adaXT-1.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d965a80517ebcfd719251d4dc262f6a77032718a90a489e7637cf973ec27258 |
|
MD5 | 8e4408cddda1d9eef675519d7eac0c34 |
|
BLAKE2b-256 | f633f0f80e9914fe99ee29df57fd01fa08c5f278290d2f80aac53bf29bc7f501 |
File details
Details for the file adaXT-1.2.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1918efdfe1138bffc59b5d1562ed613c622cb8f9456fc9ec8e85ed97048a6a58 |
|
MD5 | 51ea0be6aad150ab08ad3af51bf872b5 |
|
BLAKE2b-256 | dde2161ec026d4bb77a59ca28050908526454f603790c230234175d8d5c548e8 |
File details
Details for the file adaXT-1.2.2-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 683.4 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 786c0890bfd5aa79d2476b55c984364f4ea98a02e30dbe1e74578c1be6af0e08 |
|
MD5 | aaf8e5a241b78bd371d3691ed2543c2c |
|
BLAKE2b-256 | a815f87b7dd2668c08507fc39c8488182acb7e8ed7a5da9b6ceac3c616b10762 |
File details
Details for the file adaXT-1.2.2-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 636.8 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dfe7ab7758c2e684c7d98d28f72d72d37527b1094d4bd767a423800cd507004 |
|
MD5 | a77da719e2c1315dd95a74cfcd6458a5 |
|
BLAKE2b-256 | d9264ab4de4c29f548014036bc6114f7f2dd42bfb9861f32129cb9a74901e500 |
File details
Details for the file adaXT-1.2.2-cp310-cp310-win32.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp310-cp310-win32.whl
- Upload date:
- Size: 539.5 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa15140cf53f74b67b0f0f50f19780035e525ac4d9067cb834f58f1cbc11fde7 |
|
MD5 | b29e6eafba4de632da83a28f0aa4a890 |
|
BLAKE2b-256 | 0f74fd365f825c6c58b885f6482d2144379ed0fa0150def9c47b2ae398c98176 |
File details
Details for the file adaXT-1.2.2-cp310-cp310-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp310-cp310-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 4.1 MB
- Tags: CPython 3.10, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 117b94a2db9e9919ded1c84e1dfd9033a8eab9e662592a18db86892ee1ff613d |
|
MD5 | 02e417e303c7436b92919bbbd2c6d536 |
|
BLAKE2b-256 | 815ac2d5ba0af8f96cc8fd1cbf2bbf83ab070c3791e52a522b13b504ac3f45bd |
File details
Details for the file adaXT-1.2.2-cp310-cp310-musllinux_1_1_i686.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp310-cp310-musllinux_1_1_i686.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.10, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbe890ce58c57b1d617b5abc7ecf53b8e681aa28de890df0d05b2aa7c51e69ed |
|
MD5 | 2d5757c094de8c70702a6c1e47ea5ef3 |
|
BLAKE2b-256 | a2218efc227d6e7bf6bb621be8cec0236b6b6a913b0abf650a895faad27dca2b |
File details
Details for the file adaXT-1.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86e5545fae3f6ae136ed7138f40baae83f00d6d1070ccc05339d1d7d9b1991ed |
|
MD5 | eb1699d3d6de94bf292a0684b0c77cc9 |
|
BLAKE2b-256 | b72c4a5d46313baa37ea9473e5940e9dad4474586c8b50ada70b8ce8b710f7b8 |
File details
Details for the file adaXT-1.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88fb5c1ce641a4c95271c38fa5a9905385b13429b306faaea29c11b633e8a6e7 |
|
MD5 | c493b4e5d8f987b8edafd114a8964122 |
|
BLAKE2b-256 | 4a6825e2e26a4e17affee837362f7c6d4c5e9681bf0798b37bfa950ce9374db3 |
File details
Details for the file adaXT-1.2.2-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: adaXT-1.2.2-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 682.7 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7c02c743a37c9e9eaaad4828ac9a729870144a6f13fe2559b0474d32a190dfc |
|
MD5 | 948ec293fb3dbc7cc1236bf100136283 |
|
BLAKE2b-256 | c983d2c33a1e396e0f6497af6133ad1bb25b3075b840c922a74709e9e28a4609 |