Skip to content

Instantly share code, notes, and snippets.

@abhijeet-talaulikar
Created June 30, 2023 23:19
Show Gist options
  • Select an option

  • Save abhijeet-talaulikar/fbc37c2fd31ed322aeddcb08f935d85a to your computer and use it in GitHub Desktop.

Select an option

Save abhijeet-talaulikar/fbc37c2fd31ed322aeddcb08f935d85a to your computer and use it in GitHub Desktop.
mmm, trace = BayesianMMM("W")
import matplotlib.pyplot as plt
plt.figure(figsize=(15,5))
for channel in ['CTV', 'DIRECT_MAIL', 'EMAIL', 'TV']:
plt.plot(
trace.posterior[f'coefficient_{channel}'].values.mean(axis=(0,1)),
linewidth=2,
label=channel
)
plt.title('Effectiveness over time')
plt.xlabel('Week')
plt.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment