Skip to content

Instantly share code, notes, and snippets.

@ian-whitestone
Last active December 20, 2023 03:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ian-whitestone/2a6bd08971bbdf9aa105aa6da565504a to your computer and use it in GitHub Desktop.
Save ian-whitestone/2a6bd08971bbdf9aa105aa6da565504a to your computer and use it in GitHub Desktop.
Code for the choosing your randomization unit post - https://ianwhitestone.work/choosing-randomization-unit/
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ian-whitestone
Copy link
Author

ian-whitestone commented Feb 2, 2021

To anyone reading this who came from the blog post, there's two things in this code that I didn't actually talk about (because they'll be leveraged in a future post and I was too lazy to remove them):

  1. In the run_simulation function I have these arguments:
    conversion_dependent_on_spu=True,
    # x is conversion rate and y is sessions per user (spu)
    conversion_spu_func=lambda x,y: x*2/3 + x*1/3*np.exp(-0.4*y)

This lets me specify a decay function that maps the relationship between sessions per user and conversion rate - i.e. something like this:

  1. All the user level metrics. These will be used in conjunction with ☝️ to explore if you get an increased false positives when doing user level randomization + session level metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment