ModelAdapter.predict#

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

Return expected outcomes with canonical prediction dimensions.

Every backend returns the same container: response-scale expected outcomes as an xarray.DataArray with dimensions ("chain", "draw", "obs_ind", "treated_units"). Point-estimate backends (sklearn) return singleton chain/draw dimensions — a point estimate is a posterior with one atom.

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

  • coords (dict[str, Any] | None) – Coordinate metadata for Bayesian backends.

  • out_of_sample (bool) – Whether predictions are out-of-sample. Used by PyMC backends only.

  • group (Literal['prior', 'posterior']) – Draw group to condition forward sampling on. Bayesian backends reproduce the prediction machinery using the requested group’s draws; point-estimate backends only ever have the (implicit) posterior atom.

Returns:

Expected outcomes with dimensions ("chain", "draw", "obs_ind", "treated_units").

Return type:

xr.DataArray