Probabilistic predictions for tabular data, using diffusion models and decision trees.
Project description
Treeffuser is an easy-to-use package for probabilistic prediction on tabular data with tree-based diffusion models. Its goal is to estimate distributions of the form p(y|x) where x is a feature vector, y is a target vector and the form of p(y|x) can be arbitrarily complex (e.g multimodal, heteroskedastic, non-gaussian, heavy-tailed, etc).
It is designed to adhere closely to the scikit-learn API and requires minimal user tuning.
Usage Example
Here’s how you can use Treeffuser in your project:
from treeffuser import Treeffuser
import numpy as np
# (n_training, n_features), (n_training, n_targets)
X, y = ... # load your data
# (n_test, n_features)
X_test = ... # load your test data
# Estimate p(y|x) with a tree-based diffusion model
model = Treeffuser()
model.fit(X, y)
# Draw samples y ~ p(y|x) for each test point
# (n_samples, n_test, n_targets)
y_samples = model.sample(X_test, n_samples=1000)
# Compute downstream metrics
mean = np.mean(y_samples, axis=0)
std = np.std(y_samples, axis=0)
median = np.median(y_samples, axis=0)
quantile = np.quantile(y_samples, q=0 axis=0)
... # other metrics
Please refer to the docstrings for more information on the available methods and parameters.
Installation
You can install Treeffuser via pip from PyPI with the following command:
pip install treeffuser
You can also install the in-development version with:
pip install git+https://github.com/blei-lab/tree-diffuser.git@main
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 Distribution
File details
Details for the file treeffuser-0.1.3.tar.gz
.
File metadata
- Download URL: treeffuser-0.1.3.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.5 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ddda0b45951e332d97e038aae0b2fdf5c178176848a1459ee9a96a9e1e5d7dd |
|
MD5 | 7477a52b7a1fa9c7af803565b2c0d8af |
|
BLAKE2b-256 | 620bb6c18ac7689fd080ddd823a3b054eeeaeb532b00dfa1092dd74334359f1d |
File details
Details for the file treeffuser-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: treeffuser-0.1.3-py3-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.5 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4381f7fbf56c27897c3f6aecd3da418d118cec1f7f7d8f912f9dd0e4ab6a2d7 |
|
MD5 | c4bc86c516aff4f172a495a2ed3beb59 |
|
BLAKE2b-256 | 41ce6ced7a2d1feffbece4980f50d3478c2f5d499ad359c360e1f770b356f8c1 |