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

KnownTreatmentTimeHandler.__init__()

KnownTreatmentTimeHandler.data_postprocessing(...)

Splits data and computes predictions and causal impact metrics.

KnownTreatmentTimeHandler.data_preprocessing(...)

Preprocess the data by selecting only the pre-treatment period for model fitting.

KnownTreatmentTimeHandler.plot_impact_cumulative(ax, ...)

Plot the cumulative causal impact for the post-intervention period.

KnownTreatmentTimeHandler.plot_intervention_line(ax, ...)

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)#