Skip to content

Instantly share code, notes, and snippets.

@abhijeet-talaulikar
Created June 30, 2023 23:25
Show Gist options
  • Save abhijeet-talaulikar/f7fed3bdc9cbb309f86ee088cbc38d0f to your computer and use it in GitHub Desktop.
Save abhijeet-talaulikar/f7fed3bdc9cbb309f86ee088cbc38d0f to your computer and use it in GitHub Desktop.
mmm, trace = BayesianMMM("Q")
paid_search_df = pd.DataFrame({
'quarter': "Quarter "+pd.PeriodIndex(dates, freq='Q').astype(str).str[-1].astype(str).values,
'coefficient': trace['posterior']['coefficient_PAID_SEARCH'].mean(axis=(0,1))
})
paid_search_df.groupby('quarter').mean().plot.bar();
plt.title("Paid Search Effectiveness over Quarters")
plt.ylim(bottom=0.12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment