Super-fast BART (Bayesian Additive Regression Trees) in Python
Project description
BART vectoriZed
An implementation of Bayesian Additive Regression Trees (BART) in JAX.
If you don't know what BART is, but know XGBoost, consider BART as a sort of Bayesian XGBoost. bartz makes BART run as fast as XGBoost.
BART is a nonparametric Bayesian regression technique. Given training predictors $X$ and responses $y$, BART finds a function to predict $y$ given $X$. The result of the inference is a sample of possible functions, representing the uncertainty over the determination of the function.
This Python module provides an implementation of BART that runs on GPU, to process large datasets faster. It is also good on CPU. Most other implementations of BART are for R, and run on CPU only.
On CPU, bartz runs at the speed of dbarts (the fastest implementation I know of) if n > 20,000, but using 1/20 of the memory. On GPU, the speed premium depends on sample size; it is convenient over CPU only for n > 10,000. The maximum speedup is currently 200x, on an Nvidia A100 and with at least 2,000,000 observations.
This Colab notebook runs bartz with n = 100,000 observations, p = 1000 predictors, 10,000 trees, for 1000 MCMC iterations, in 10 minutes.
BART is a very flexible method with many variants. This implementation provides only a small subset of the possible features. If you need a feature from another BART implementation or from the BART literature, please open an issue on github.
Links
- Documentation (latest release)
- Documentation (development version)
- Repository
- Code coverage
- Benchmarks
- List of BART packages
Citing bartz
Article: Petrillo (2024), "Very fast Bayesian Additive Regression Trees on GPU", arXiv:2410.23244.
To cite the software directly, including the specific version, use zenodo.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bartz-0.8.0.tar.gz.
File metadata
- Download URL: bartz-0.8.0.tar.gz
- Upload date:
- Size: 82.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1942e97deef6a86bcbfe9dad107319b8d2f39415c8bcad4be9a75c09bfc85ff2
|
|
| MD5 |
0d75c8060360224227ec3e2939870e2f
|
|
| BLAKE2b-256 |
246b26ffdff7e985042aa1d88a9eab03e68854d8830c22094f820abd5a3abff5
|
File details
Details for the file bartz-0.8.0-py3-none-any.whl.
File metadata
- Download URL: bartz-0.8.0-py3-none-any.whl
- Upload date:
- Size: 102.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b8bc2ed68f1516bc8056eca312c0f23656fa1f17afa3d6e698a5384e21199f2
|
|
| MD5 |
992f410db008d8e95174b0815c86ae63
|
|
| BLAKE2b-256 |
98a679136db9f9996e2be78d30882efa893a8b134263511b3f24857c6e27b7eb
|