[Paper Review] Bayesian additive regression trees for probabilistic programming
This paper introduces PyMC-BART, a probabilistic programming extension that integrates Bayesian Additive Regression Trees (BART) as a first-class primitive within the PyMC framework. By enabling BART to be used alongside other probabilistic models and natively supporting MCMC inference via a novel PGBART sampler, the method allows users to build flexible, uncertainty-aware models with minimal tuning while retaining full compatibility with PyMC’s ecosystem for inference, diagnostics, and model comparison.
Bayesian additive regression trees (BART) is a non-parametric method to approximate functions. It is a black-box method based on the sum of many trees where priors are used to regularize inference, mainly by restricting trees' learning capacity so that no individual tree is able to explain the data, but rather the sum of trees. We discuss BART in the context of probabilistic programming languages (PPL), i.e., we present BART as a primitive that can be used as a component of a probabilistic model rather than as a standalone model. Specifically, we introduce the Python library PyMC-BART, which works by extending PyMC, a library for probabilistic programming. We showcase a few examples of models that can be built using PyMC-BART, discuss recommendations for the selection of hyperparameters, and finally, we close with limitations of our implementation and future directions for improvement.
Motivation & Objective
- To bridge the gap between BART as a standalone non-parametric model and its use as a modular component in broader probabilistic programming frameworks.
- To enable seamless integration of BART into arbitrary probabilistic models within the PyMC ecosystem, treating BART as a first-class random variable.
- To provide a scalable, modular inference mechanism—PGBART—that supports efficient MCMC sampling for BART components while maintaining compatibility with other PyMC samplers like NUTS.
- To support advanced modeling tasks such as variable selection, posterior interpretation, and convergence diagnostics through dedicated tools built into the PyMC-BART pipeline.
- To establish a foundation for future extensibility of BART in probabilistic programming, moving beyond fixed-model implementations toward composable, reusable components.
Proposed method
- The core method introduces a new BART random variable in PyMC, allowing users to define BART as part of a larger probabilistic model using standard PyMC syntax.
- A novel PGBART (Particle Gibbs BART) sampler is implemented, which uses sequential Monte Carlo (SMC) principles to resample individual trees in the sum, updating them one at a time with a subset of trees per iteration.
- The PGBART sampler uses particle trees to explore the space of possible tree structures, with resampling based on normalized log-likelihood weights to favor high-probability trees.
- Tree growth is guided by a depth-dependent prior with parameters α=0.95 and β=2, and splitting variables are selected using a dynamic, adaptive categorical distribution updated during tuning.
- Leaf node values are assigned a normal prior centered on the current prediction mean, with variance scaled by the residual standard deviation and adjusted per data type (e.g., binomial vs. continuous).
- Variable importance is estimated via a running count of splitting variable usage, with a sparsity-inducing Dirichlet prior on splitting proportions to enhance interpretability.
Experimental results
Research questions
- RQ1How can BART be effectively embedded as a first-class component within a probabilistic programming language like PyMC, rather than as a standalone model?
- RQ2What sampling strategy enables efficient and scalable inference for BART within a modular probabilistic programming framework?
- RQ3How can variable importance and model interpretability be systematically supported in a composable BART-based modeling pipeline?
- RQ4What hyperparameter choices—especially the number of trees—most significantly affect model performance and convergence in practice?
- RQ5How can the integration of BART into PyMC preserve compatibility with existing tools for model diagnostics, posterior checking, and model comparison?
Key findings
- PyMC-BART enables users to compose BART as a component within arbitrary probabilistic models using standard PyMC syntax, with no need to modify existing workflows.
- The PGBART sampler achieves efficient posterior exploration by updating a subset of trees (default 10% of total) per iteration, reducing computational cost while maintaining convergence.
- Variable importance is estimated through a dynamic counting mechanism that tracks splitting variable usage, with a sparsity-inducing prior improving interpretability.
- The method maintains full compatibility with ArviZ and PyMC’s diagnostics stack, allowing users to assess convergence, compare models, and visualize posteriors without learning new tools.
- The implementation supports uncertainty quantification via posterior predictive intervals, consistent with BART’s strengths in non-parametric Bayesian modeling.
- Empirical results show that the PGBART sampler achieves stable convergence and accurate posterior estimation across diverse data types, including binomial and continuous outcomes.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.