PyMCModelAdapter#
- class causalpy.experiments.model_adapter.PyMCModelAdapter[source]#
Adapter for
PyMCModelbackends.- Parameters:
model (
PyMCModel) – Fitted or unfitted PyMC backend model.
Methods
PyMCModelAdapter.build(X, y, *[, coords])Merge priors and construct the PyMC graph without sampling.
PyMCModelAdapter.coefficients(*[, group])Return coefficient draws from the requested group, canonically.
PyMCModelAdapter.fit(X, y, *[, coords])Fit the PyMC model (build + prior phase + posterior phase).
PyMCModelAdapter.predict(X, *[, coords, ...])Predict expected outcomes using the PyMC model.
Print model coefficients with labels.
Return fitted inference-result DataTree or raise an explicit capability error.
PyMCModelAdapter.sample_posterior(**kwargs)Sample the posterior phase on the built graph.
Sample the prior predictive phase on the built graph.
PyMCModelAdapter.score(X, y, *[, coords])Score predictions from the PyMC model.
Attributes
has_posteriorWhether posterior draws are available.
has_priorWhether prior draws are available.
idataReturn the model's DataTree when fitted.
is_bayesianWhether the backend is Bayesian (PyMC or pymc-forecast).
is_builtWhether the PyMC graph has been constructed.
is_olsWhether the backend is OLS/sklearn.
kindBackend identifier.
modelThe underlying PyMC model.
supports_idataWhether the backend exposes an inference-result DataTree.
supports_prior_predictiveWhether the wrapped PyMC model exposes a prior predictive phase.
- classmethod __new__(*args, **kwargs)#