PyMCForecastAdapter#
- class causalpy.experiments.model_adapter.PyMCForecastAdapter[source]#
Adapter for
PyMCForecastModelbackends.The wrapped model already speaks CausalPy’s Bayesian conventions (
mu/y_hatposterior-predictive output onobs_ind/treated_unitscoords), so this adapter is pure delegation.- Parameters:
model (
PyMCForecastModel) – Wrappedpymc_forecastbackend model.
Methods
Forecasting models have no design-matrix coefficients.
PyMCForecastAdapter.fit(X, y, *[, coords])Fit the forecasting model on the pre-period.
PyMCForecastAdapter.predict(X, *[, coords, ...])Predict in-sample or forecast the counterfactual.
Print posterior summaries of the model's scalar parameters.
Return fitted inference-result DataTree or raise an explicit capability error.
PyMCForecastAdapter.score(X, y, *[, coords])Score in-sample predictions with the Bayesian \(R^2\).
Attributes
idataReturn the model's DataTree when fitted.
is_bayesianWhether the backend is Bayesian (PyMC or pymc-forecast).
is_olsWhether the backend is OLS/sklearn.
kindBackend identifier.
modelThe underlying pymc-forecast wrapper.
supports_idataWhether the backend exposes an inference-result DataTree.
- __init__(model)[source]#
- Parameters:
model (PyMCForecastModel)
- Return type:
None
- classmethod __new__(*args, **kwargs)#