Skip to main content

Probabilistic Gradient Boosting Machines

Project description

PGBM Airlab Amsterdam

PyPi version Python version GitHub license

Probabilistic Gradient Boosting Machines (PGBM) is a probabilistic gradient boosting framework in Python based on PyTorch/Numba, developed by Airlab in Amsterdam. It provides the following advantages over existing frameworks:

  • Probabilistic regression estimates instead of only point estimates. (example)
  • Auto-differentiation of custom loss functions. (example, example)
  • Native GPU-acceleration. (example)
  • Distributed training for CPU and GPU, across multiple nodes. (examples)
  • Ability to optimize probabilistic estimates after training for a set of common distributions, without retraining the model. (example)
  • Full integration with scikit-learn through a fork of HistGradientBoostingRegressor (examples)

It is aimed at users interested in solving large-scale tabular probabilistic regression problems, such as probabilistic time series forecasting.

For more details, read the docs or our paper or check out the examples.

Below a simple example to generate 1000 estimates for each of our test points:

from pgbm.sklearn import HistGradientBoostingRegressor
from sklearn.model_selection import train_test_split
from sklearn.datasets import fetch_california_housing

X, y = fetch_california_housing(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1)
model = HistGradientBoostingRegressor().fit(X_train, y_train) 
yhat_test, yhat_test_std = model.predict(X_test, return_std=True)
yhat_dist = model.sample(yhat_test, yhat_test_std, n_estimates=1000)

See also this example where we compare PGBM to standard gradient boosting quantile regression methods, demonstrating that we can achieve comparable or better probabilistic performance whilst only training a single model.

Installation

See Installation section in our docs.

Support

In general, PGBM works similar to existing gradient boosting packages such as LightGBM or xgboost (and it should be possible to more or less use it as a drop-in replacement).

In case further support is required, open an issue.

Reference

Olivier Sprangers, Sebastian Schelter, Maarten de Rijke. Probabilistic Gradient Boosting Machines for Large-Scale Probabilistic Regression. Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD 21), August 14–18, 2021, Virtual Event, Singapore.

The experiments from our paper can be replicated by running the scripts in the experiments folder. Datasets are downloaded when needed in the experiments except for higgs and m5, which should be pre-downloaded and saved to the datasets folder (Higgs) and to datasets/m5 (m5).

License

This project is licensed under the terms of the Apache 2.0 license.

Acknowledgements

This project was developed by Airlab Amsterdam.

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

pgbm-2.3.0.tar.gz (1.4 MB view hashes)

Uploaded Source

Built Distributions

pgbm-2.3.0-cp311-cp311-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

pgbm-2.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.7 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pgbm-2.3.0-cp311-cp311-macosx_12_0_arm64.whl (2.4 MB view hashes)

Uploaded CPython 3.11 macOS 12.0+ ARM64

pgbm-2.3.0-cp311-cp311-macosx_10_13_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.11 macOS 10.13+ x86-64

pgbm-2.3.0-cp310-cp310-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

pgbm-2.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pgbm-2.3.0-cp310-cp310-macosx_12_0_arm64.whl (2.4 MB view hashes)

Uploaded CPython 3.10 macOS 12.0+ ARM64

pgbm-2.3.0-cp310-cp310-macosx_10_13_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.10 macOS 10.13+ x86-64

pgbm-2.3.0-cp39-cp39-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

pgbm-2.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pgbm-2.3.0-cp39-cp39-macosx_12_0_arm64.whl (2.4 MB view hashes)

Uploaded CPython 3.9 macOS 12.0+ ARM64

pgbm-2.3.0-cp39-cp39-macosx_10_13_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.9 macOS 10.13+ x86-64

pgbm-2.3.0-cp38-cp38-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pgbm-2.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pgbm-2.3.0-cp38-cp38-macosx_12_0_arm64.whl (2.4 MB view hashes)

Uploaded CPython 3.8 macOS 12.0+ ARM64

pgbm-2.3.0-cp38-cp38-macosx_10_13_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.8 macOS 10.13+ x86-64

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