PyMCModelAdapter#

class causalpy.experiments.model_adapter.PyMCModelAdapter[source]#

Adapter for PyMCModel backends.

Parameters:

model (PyMCModel) – Fitted or unfitted PyMC backend model.

Methods

PyMCModelAdapter.coefficients()

Return posterior coefficient draws in the canonical container.

PyMCModelAdapter.fit(X, y, *[, coords])

Fit the PyMC model.

PyMCModelAdapter.predict(X, *[, coords, ...])

Predict expected outcomes using the PyMC model.

PyMCModelAdapter.print_coefficients(labels)

Print model coefficients with labels.

PyMCModelAdapter.require_idata()

Return fitted inference-result DataTree or raise an explicit capability error.

PyMCModelAdapter.score(X, y, *[, coords])

Score predictions from the PyMC model.

Attributes

idata

Return the model's DataTree when fitted.

is_bayesian

Whether the backend is Bayesian (PyMC or pymc-forecast).

is_ols

Whether the backend is OLS/sklearn.

kind

Backend identifier.

model

The underlying PyMC model.

supports_idata

Whether the backend exposes an inference-result DataTree.

__init__(model)[source]#
Parameters:

model (PyMCModel)

Return type:

None

classmethod __new__(*args, **kwargs)#