UnknownTreatmentTimeHandler#
- class causalpy.experiments.interrupted_time_series.UnknownTreatmentTimeHandler[source]#
A utility class for managing data preprocessing, postprocessing, and plotting steps for models that infer unknown treatment times.
This handler prepares input data for the model, extracts relevant outputs after inference, and structures them for further analysis and visualization.
Methods
Postprocesses model outputs and input data using the inferred treatment time.
Preprocesses the input data by constraining the model's treatment time inference window.
Plot the cumulative causal impact over the full time series.
Draw a vertical line at the inferred treatment time and shade the HDI interval around it.
UnknownTreatmentTimeHandler.plot_treated_counterfactual
(ax, ...)Plot the predicted post-intervention trajectory, including its Highest Density Interval (HDI), on the first subplot.
- __init__()#
- classmethod __new__(*args, **kwargs)#