pymc-devs/pymc-bart

Is it possible to use BART models with non-default samplers?

j-adamczyk opened this issue · 2 comments

When I try to train BART with any sampler other than "pymc", I get an error:

ValueError: Model can not be sampled with NUTS alone. Your model is probably not continuous.

This makes sense, since BART is a discrete model. However, does that mean that it is not possible (even theoretically) to e.g. use GPU-enabled samplers like NumPyro? This would be quite worrying, since even extremely tiny bikes example from the docs takes almost a minute on my CPU.

It is not possible. BART needs a custom sampler.

NumPyro does not have a sampler suitable for BART variables. Actually, a large part of the PyMC-BART code is the sampler that runs on trees. We are working on a faster version of the PGBART sampler at two levels, one is improving the efficiency of the algorithm itself, the other accelerating the Python code using numba and Cython, or even just rewriting it in RUST (see for example https://github.com/elanmart/rust-pgbart, that implements and older version of PyMC-BART in RUST)

Ok, this makes sense. So for now I will try other approaches than BART, the current sampler is not particularly feasible for large datasets.