Skip to content

Instantly share code, notes, and snippets.

@abhijeet-talaulikar
Created June 30, 2023 23:27
Show Gist options
  • Save abhijeet-talaulikar/3c0c2ba671ff80dda1b5eb28750edb58 to your computer and use it in GitHub Desktop.
Save abhijeet-talaulikar/3c0c2ba671ff80dda1b5eb28750edb58 to your computer and use it in GitHub Desktop.
mmm, trace = BayesianMMM("YoY")
paid_search_df = pd.DataFrame({
'year': np.array(["Year before that"]*52 + ["Last Year"]*52),
'coefficient': trace['posterior']['coefficient_PAID_SEARCH'].mean(axis=(0,1))
})
display(paid_search_df.groupby('year').mean())
paid_search_df.groupby('year').mean().plot.bar();
plt.ylim(bottom=0.12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment