Last active
October 2, 2015 15:39
-
-
Save hughdbrown/e454548e0de9fd5c2108 to your computer and use it in GitHub Desktop.
Data science: a-b-test
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
import numpy | |
import scipy.stats as scs | |
def a_b_test(new_views, new_clicks, old_views, old_clicks, size=10000): | |
new_site = scs.beta(a=new_clicks + 1, b=new_views + 1).rvs(size=size) | |
old_site = scs.beta(a=old_clicks + 1, b=old_views + 1).rvs(size=size) | |
return (new_site > old_site).mean() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment