Is using the BART's predict function a correct way to predict new data?

We have changed BART for better integration with PyMC. If you want predictions, you can just call pm.sample_posterior_predictive() as you would do with standard PyMC model, you can also use MutableData like:

    with pm.Model() as model:
        data_X = pm.MutableData("data_X", X)
        mu = pmb.BART("mu", data_X, Y)
        ...
        ...
        idata = pm.sample()

    with model:
        pm.set_data({"data_X": another_X})
        ppc2 = pm.sample_posterior_predictive(idata)

We will extend the documentation to show this and other examples.

3 Likes