How do we predict on new unseen groups in a hierarchical model in PyMC3?

This example is helpful; thanks, @lucianopaz .

Now that pm.trace_to_dataframe has been removed in pymc, what’s the new way to do the following? Is there anything subtle needed for the include_transformed?

    df = pm.trace_to_dataframe(train_trace,
                               varnames=['mu_beta', 'sigma_beta', 'a'],
                               include_transformed=True)

The prediction section of the tutorial on multilevel models says that one can make predictions on existing and new groups. But it only gives an example of predicting on an existing group. It would be neat to add an example of predicting on a new group to that tutorial.

1 Like