Skip to content

Instantly share code, notes, and snippets.

View thismlguy's full-sized avatar

Aarshay Jain thismlguy

View GitHub Profile
@thismlguy
thismlguy / click_rate_per_context.py
Created January 10, 2020 20:36
Offline Estimates of Online Metrics using Causal Inference
# set ads
num_ads = 3
ads = np.asarray(["ad_{}".format(i) for i in range(num_ads)])
# assign random priors to contexts
ad_interaction_priors = np.asarray([0.1, 0.3, 0.6])
user_context_priors = {context:np.random.permutation(ad_interaction_priors) for context in user_contexts}