Skip to main content

Next-generation differentiable gradient boosting with JAX

Project description

jaxboost

Differentiable gradient boosting in JAX.

⚠️ This is a personal learning project, very much a work in progress. There is no intention to replace production boosting libraries like XGBoost, LightGBM, or CatBoost. The main purpose is to learn JAX while rethinking gradient boosting from first principles. No guarantee of reliability or correctness for now. Issues welcome!

What it is

A gradient boosting implementation using soft (differentiable) oblivious trees. The entire model is trained end-to-end with gradient descent via optax, rather than the traditional greedy tree-building approach.

Key characteristics:

  • Soft routing with sigmoid functions (trees are differentiable)
  • Oblivious tree structure (same split at each level)
  • Hyperplane splits (linear combinations of features)
  • Runs on GPU via JAX

Installation

pip install jaxboost

Or from source:

git clone https://github.com/jxu/jaxboost.git
cd jaxboost
pip install -e .

Usage

from jaxboost import GBMTrainer, TrainerConfig

# Regression
trainer = GBMTrainer(task="regression")
model = trainer.fit(X_train, y_train)
predictions = model.predict(X_test)

# Classification
trainer = GBMTrainer(task="classification")
model = trainer.fit(X_train, y_train)
probabilities = model.predict(X_test)
classes = model.predict_class(X_test)

Configuration

config = TrainerConfig(
    n_trees=20,          # Number of trees
    depth=4,             # Tree depth
    learning_rate=0.01,  # Optimizer learning rate
    epochs=500,          # Training epochs
    patience=50,         # Early stopping patience
    verbose=True,        # Print progress
)
trainer = GBMTrainer(task="regression", config=config)

Requirements

  • Python >= 3.10
  • JAX >= 0.4.20
  • optax >= 0.1.7

License

MIT

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

jaxboost-0.1.0.tar.gz (121.3 kB view details)

Uploaded Source

Built Distribution

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

jaxboost-0.1.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file jaxboost-0.1.0.tar.gz.

File metadata

  • Download URL: jaxboost-0.1.0.tar.gz
  • Upload date:
  • Size: 121.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jaxboost-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e9f9e3601db35eb9624f7c4ac115e691702220610a7290284b91a19b4fead78
MD5 8c1e6a5c0c9892e0163cbd81ca1f0e1a
BLAKE2b-256 639f03baff91267ef3109677df9fd4bf2f06dca5bf54490169c32a4686967a0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for jaxboost-0.1.0.tar.gz:

Publisher: publish.yml on jxucoder/jaxboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jaxboost-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jaxboost-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jaxboost-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40d9e153544dc9a7544a157e7f76b9d379d6b75a2394d75c93f78427dddda7e7
MD5 7e77fe08c80eca2b81784e961653b51d
BLAKE2b-256 8ce621fa394549165b8a4d25b2b68f7447d64f25b8b3700e1eebb111475bebf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for jaxboost-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jxucoder/jaxboost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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