ModelAdapter.predict#

abstractmethod ModelAdapter.predict(X, *, coords=None, out_of_sample=False)[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.

Returns:

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

Return type:

xr.DataArray