ModelAdapter#
- class causalpy.experiments.model_adapter.ModelAdapter[source]#
Experiment-agnostic wrapper around a CausalPy statistical backend.
Methods
Return point estimates of model coefficients.
ModelAdapter.fit(X, y, *[, coords])Fit the model with backend-appropriate conventions.
ModelAdapter.predict(X, *[, coords, ...])Return expected outcomes with canonical prediction dimensions.
ModelAdapter.print_coefficients(labels[, ...])Print model coefficients with labels.
Return fitted inference-result DataTree or raise an explicit capability error.
ModelAdapter.score(X, y, *[, coords])Return per-unit \(R^2\) scores in the canonical container.
Attributes
idataReturn a fitted inference-result DataTree when supported, otherwise
None.is_bayesianWhether the backend is Bayesian (PyMC or pymc-forecast).
is_olsWhether the backend is OLS/sklearn.
kindBackend identifier.
modelThe underlying model instance.
supports_idataWhether the backend exposes an inference-result DataTree.
- __init__()#
- classmethod __new__(*args, **kwargs)#