XGBoostLSS - An extension of XGBoost to probabilistic forecasting
We propose a new framework of XGBoost that predicts the entire conditional distribution of univariate and multivariate responses. In particular, XGBoostLSS models all moments of a parametric distribution, i.e., mean, location, scale and shape (LSS), instead of the conditional mean only. Choosing from a wide range of continuous, discrete, and mixed discrete-continuous distribution, modelling and predicting the entire conditional distribution greatly enhances the flexibility of XGBoost, as it allows to create probabilistic forecasts from which prediction intervals and quantiles of interest can be derived.
Features
News
Installation
To install XGBoostLSS, please first run
pip install git+https://github.com/StatMixedML/XGBoostLSS.git
Then, to install the shap-dependency, run
pip install git+https://github.com/dsgibbons/shap.git
How to use
We refer to the example section for example notebooks.
Available Distributions
XGBoostLSS currently supports the following PyTorch distributions.
Distribution | Usage | Type | Support | Number of Parameters |
---|---|---|---|---|
Beta | Beta() |
Continuous (Univariate) |
2 | |
Cauchy | Cauchy() |
Continuous (Univariate) |
2 | |
Expectile | Expectile() |
Continuous (Univariate) |
Number of expectiles | |
Gamma | Gamma() |
Continuous (Univariate) |
2 | |
Gaussian | Gaussian() |
Continuous (Univariate) |
2 | |
Gumbel | Gumbel() |
Continuous (Univariate) |
2 | |
Laplace | Laplace() |
Continuous (Univariate) |
2 | |
LogNormal | LogNormal() |
Continuous (Univariate) |
2 | |
Negative Binomial | NegativeBinomial() |
Discrete Count (Univariate) |
2 | |
Poisson | Poisson() |
Discrete Count (Univariate) |
1 | |
Student-T | StudentT() |
Continuous (Univariate) |
3 | |
Weibull | Weibull() |
Continuous (Univariate) |
2 | |
Zero-Adjusted Beta | ZABeta() |
Discrete-Continuous (Univariate) |
3 | |
Zero-Adjusted Gamma | ZAGamma() |
Discrete-Continuous (Univariate) |
3 | |
Zero-Adjusted LogNormal | ZALN() |
Discrete-Continuous (Univariate) |
3 | |
Zero-Inflated Negative Binomial | ZINB() |
Discrete-Count (Univariate) |
3 | |
Zero-Inflated Poisson | ZIPoisson() |
Discrete-Count (Univariate) |
2 |
Some Notes
Stabilization
Since XGBoostLSS updates the parameter estimates by optimizing Gradients and Hessians, it is important that these are comparable in magnitude for all distributional parameters. Due to variability regarding the ranges, the estimation of Gradients and Hessians might become unstable so that XGBoostLSS might not converge or might converge very slowly. To mitigate these effects, we have implemented a stabilization of Gradients and Hessians.
For improved convergence, an alternative approach is to standardize the (continuous) response variable, such as dividing it by 100 (e.g., y/100). This approach proves especially valuable when the response range significantly differs from that of Gradients and Hessians. Nevertheless, it is essential to carefully evaluate and apply both the built-in stabilization and response standardization techniques in consideration of the specific dataset at hand.
Runtime
Since XGBoostLSS updates all distributional parameters simultaneously, it requires training [number of iterations] * [number of distributional parameters]
trees. Hence, the runtime of XGBoostLSS is generally slightly higher as compared to XGBoost, which requires training [number of iterations]
trees only.
Feedback
We encourage you to provide feedback on how to enhance XGBoostLSS or request the implementation of additional distributions by opening a new issue.
Reference Paper
MΓ€rz, Alexander (2022): Multi-Target XGBoostLSS Regression.
MΓ€rz, A. and Kneib, T.: (2022) Distributional Gradient Boosting Machines.
MΓ€rz, Alexander (2019): XGBoostLSS - An extension of XGBoost to probabilistic forecasting.