Last active
December 22, 2019 14:03
-
-
Save vlavorini/4825d263544b86bf9d695af001e0838e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import beta | |
import numpy as np | |
from calc_prob import calc_prob_between | |
#This is the known data: imporessions and conversions for the Control and Test set | |
imps_ctrl,convs_ctrl=16500, 30 | |
imps_test, convs_test=17000, 50 | |
#here we create the Beta functions for the two sets | |
a_C, b_C = convs_ctrl+1, imps_ctrl-convs_ctrl+1 | |
beta_C = beta(a_C, b_C) | |
a_T, b_T = convs_test+1, imps_test-convs_test+1 | |
beta_T = beta(a_T, b_T) | |
#calculating the lift | |
lift=(beta_T.mean()-beta_C.mean())/beta_C.mean() | |
#calculating the probability for Test to be better than Control | |
prob=calc_prob_between(beta_T, beta_C) | |
print (f"Test option lift Conversion Rates by {lift*100:2.2f}% with {prob*100:2.1f}% probability.") | |
#output: Test option lift Conversion Rates by 59.68% with 98.2% probability. |
yes: null
is Java, in Python you can use None
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you know what could be the problem here?