-1

My question is the same one being asked here but in regards to the Python port of the package, rather than in r.

https://stats.stackexchange.com/questions/424433/causal-impact-how-to-show-all-data-points-in-predicted-series

I am using the below code to run the model and plot out the results & summary, but I'd like to access the predicted values so I can export them. Is this possible in Python?

pre_period = [0, index_dict['2022-08-29']]
post_period = [index_dict['2022-09-05'],len(model_df)-1]

ci = CausalImpact(model_df, pre_period, post_period)
ci.run()
ci.plot()
print(ci.summary())
print(ci.summary(output='report'))
Alen Paul Varghese
  • 1,278
  • 14
  • 27

1 Answers1

0

For anyone wondering it looks like running ci.inferences gives you the outputs in a dataframe. ci.inferences.point_pred being the predicted output from the synthetic control.

Using inspect on the plot function revealed a lot of info about how the plots are constructed, as explained in this thread. Is there a way a save plot generated by causalimpact in python?