KnownTreatmentTimeHandler#
- class causalpy.experiments.interrupted_time_series.KnownTreatmentTimeHandler[source]#
Handles data preprocessing, postprocessing, and plotting logic for models where the treatment time is known in advance.
Methods
Splits data and computes predictions and causal impact metrics.
Preprocess the data by selecting only the pre-treatment period for model fitting.
Plot the cumulative causal impact for the post-intervention period.
Plot a vertical line at the known treatment time on all subplots.
KnownTreatmentTimeHandler.plot_treated_counterfactual
(ax, ...)Optional: override if needed
- __init__()#
- classmethod __new__(*args, **kwargs)#