Pipeline#
- class causalpy.pipeline.Pipeline[source]#
Orchestrate a sequence of causal-inference steps.
The pipeline validates all steps before executing any of them, ensuring configuration errors are caught before potentially expensive model fitting.
- Parameters:
Examples
>>> import causalpy as cp >>> result = cp.Pipeline( ... data=df, ... steps=[ ... cp.EstimateEffect( ... method=cp.InterruptedTimeSeries, ... treatment_time=pd.Timestamp("2020-01-01"), ... formula="y ~ 1 + t", ... model=cp.pymc_models.LinearRegression(), ... ), ... ], ... ).run()
Methods
Pipeline.__init__(data, steps)Validate all steps, then execute them sequentially.
- classmethod __new__(*args, **kwargs)#