bentools/split-test-analyzer
最新稳定版本:1.1
Composer 安装命令:
composer require bentools/split-test-analyzer
包简介
Bayesian probability calculator for split testing / AB testing.
关键字:
README 文档
README
Split Test Analyzer
This PHP tool will help you compute, for different versions of a split test, their probability to be the best one.
It is a PHP port of the JS tool used on AB split test graphical Bayesian calculator.
Concept
A Variation object is composed of 3 informations:
- A
keyto identify it (the Landing page / banner id for instance) - The total number of actions (let's say, the unique visitors)
- The number of successful actions (let's say, the conversions)
Now you can compare those 3 objects and compute their probability to be the best.
Usage
use BenTools\SplitTestAnalyzer\SplitTestAnalyzer; use BenTools\SplitTestAnalyzer\Variation; require_once __DIR__ . '/vendor/autoload.php'; $variations = [ new Variation('LP #1', 8686347, 932), new Variation('LP #2', 7305026, 804), new Variation('LP #3', 4592639, 371), new Variation('LP #4', 4590186, 402), new Variation('LP #5', 4532325, 470), new Variation('LP #6', 4531653, 494), ]; $predictor = SplitTestAnalyzer::create()->withVariations(...$variations); foreach ($predictor->getResult() as $key => $value) { printf('%s has %d%% chances to be the best one.' . PHP_EOL, $key, $value); } print PHP_EOL; printf('The best one is: %s', $predictor->getBestVariation());
Output:
LP #1 has 15% chances to be the best one. LP #2 has 43% chances to be the best one. LP #3 has 0% chances to be the best one. LP #4 has 0% chances to be the best one. LP #5 has 7% chances to be the best one. LP #6 has 34% chances to be the best one. The best one is: LP #2
Because of the randomness used in Bayes calculator, results may slightly vary.
To improve performance you can lower the amount of samples with SplitTestAnalyzer::create(100), but then you'll have to choose between performance and reliability.
Installation
This library requires PHP 7.0+.
composer require bentools/split-test-analyzer
Tests
./vendor/bin/phpunit
See also
统计信息
- 总下载量: 20.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-28