A/B Testing的简要知识

A/B testing主要用来检测网站或者APP的两个版本中哪一个更好,它的中心思想是把流量一分为二,一份用作experiment group,访问新的版本,另一份用作control group,访问旧的版本。

假设现在有一个网站,要测试是否增大网页Register的字体,可以增加注册用户。

进行AB testing,首先要选择Unit of Diversion, 就是把实验分成两组的标准。在这个实验中,可以选择unique cookies to view the web page. 然后要选定Invariant metrics, 选择那些在两个版本之间不会变化,而是一致的变量。我们这个简单的例子中,可以选择网页的访问量,the unique cookies to view the web page,跟Unit of Diversion相同。然后选择Variant metrics, 要选那些可以衡量版本变化带来不同实现目标的变量,比如click-through-rate, the number of unique cookies to click register divided by the unique cookies to view the page; 比如gross conversion, the number of unique cookies to complete registration divided by the unique cookies to view the page.

选好Invariant 和Variant metrics后,就可以开始设计怎么开展实验。要选择在哪里进行,只是针对某一个国家,或者全世界;要决定实验周期,不能太久,因为用户可能渐渐适应改变,变得不再有效不再敏感,也不能太短,这样没有足够多用户接触到改变。根据情况,一般一个月就足够了。

测试过程中统计每天访问网页的cookies数目,点击了register的cookies数,以及成功完成注册的cookies. 在得到这些数据后,就是用统计学知识做假设检验。首先需要对invariant metrics做sanity check, 通过以后要进行effect size test和sign test. Sanity check的目的是要确保两组试验的网页访问量(unique cookies to view web page)差别可以忽略。

 

假设实验组和对照组的invariant metrics分别是X和Y。

那么标准误差standard error为:

 

根据置信水平significant level 95%, 查到Z值为1.96,( http://www.utdallas.edu/dept/abp/zscoretable.pdf )

那么误差区间margin of error为:

 

Invariant metric实际差别为:

 

如果误差区间m小于实际差别,通过invariant check的sanity check, 否则不可以进行下一步检测。

 

Effect size test实际上是假设检验,

 

假设X_exp和N_exp为是实验组的gross conversion和 number of cookies, X_cont和N_cont为是对照组的gross conversion和 number of cookies,那么概率

 

 如果d的绝对值大于1.96乘以SE_pool,那么拒绝null hypothesis, 两个版本的网页是有差别的,置信水平为95%。

 

Sign test更进一步,检测每一天是否新版本新注册用户比旧版本多。可以用graphpad网站( http://graphpad.com/quickcalcs/binomial1.cfm )来进行测试,number of ‘success’是新版本比旧版本注册用户多的天数, Number of trials是总共天数,probability是0.5, 得到的p value必须要小于alpha, 在这个例子中,等于1-95%=0.05

 

这几个步骤是进行AB Testing的基础,还有很多重要方面需要注意,比如

在试验前,统计每个metrics的值,得到baseline information,比如每天的cookies, CTR, Gross conversion等 

计算每个invariant metrics的方差,如果invariant metrics的unit of analysis不是unit of diversion,选用经验方差empirical variance

计算sample size样本大小,结合baseline information, 来精确计算实验的周期 ( http://www.evanmiller.org/ab-testing/sample-size.html )

如果可以其中一个metric假设检验成功就可以下结论,那么会用到Bonferroni correction

 

 



原文地址:https://www.cnblogs.com/guanghuiz/p/4963570.html