PyMCModelAdapter.predict#

PyMCModelAdapter.predict(X, *, coords=None, out_of_sample=False, group='posterior')[source]#

Predict expected outcomes using the PyMC model.

Parameters:
  • X (Any) – Predictor matrix for which to generate predictions.

  • coords (dict[str, Any] | None) – Coordinate metadata for the PyMC model.

  • out_of_sample (bool) – Whether predictions are out-of-sample.

  • group (Literal['prior', 'posterior']) – Draw group to condition forward sampling on. The returned draws always land in the posterior_predictive group (PyMC’s output location regardless of conditioning group) but carry the conditioning group’s chain/draw sizes.

Returns:

Forward draws of mu with canonical prediction dimensions.

Return type:

xr.DataArray

Notes

Reading posterior_predictive here is correct for prior-conditioned output too; do not “fix” it to read idata[group].