-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7149535
Showing
61 changed files
with
10,450 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# .coveragerc to control coverage.py | ||
[run] | ||
branch = True | ||
source = abexp | ||
# omit = bad_file.py | ||
|
||
[paths] | ||
source = | ||
src/ | ||
*/site-packages/ | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self\.debug | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Temporary and binary files | ||
*~ | ||
*.py[cod] | ||
*.so | ||
*.cfg | ||
!.isort.cfg | ||
!setup.cfg | ||
*.orig | ||
*.log | ||
*.pot | ||
__pycache__/* | ||
.cache/* | ||
.*.swp | ||
*/.ipynb_checkpoints/* | ||
.DS_Store | ||
|
||
# Project files | ||
.ropeproject | ||
.project | ||
.pydevproject | ||
.settings | ||
.idea | ||
tags | ||
|
||
# Package files | ||
*.egg | ||
*.eggs/ | ||
.installed.cfg | ||
*.egg-info | ||
|
||
# Unittest and coverage | ||
htmlcov/* | ||
.coverage | ||
.tox | ||
junit.xml | ||
coverage.xml | ||
.pytest_cache/ | ||
|
||
# Build and docs folder/files | ||
build/* | ||
dist/* | ||
sdist/* | ||
docs/_rst/* | ||
docs/build/* | ||
cover/* | ||
MANIFEST | ||
|
||
# Per-project virtualenvs | ||
.venv*/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[settings] | ||
line_length=120 | ||
indent=' ' | ||
skip=.tox,.venv,build,dist | ||
known_standard_library=setuptools,pkg_resources | ||
known_test=pytest | ||
known_first_party=abexp | ||
sections=FUTURE,STDLIB,COMPAT,TEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER | ||
default_section=THIRDPARTY | ||
multi_line_output=3 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
exclude: '^docs/conf.py' | ||
|
||
repos: | ||
- repo: git://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.2.3 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: mixed-line-ending | ||
args: ['--fix=no'] | ||
|
||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.7.9 | ||
hooks: | ||
- id: flake8 | ||
args: ['--append-config=setup.cfg'] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v4.3.4 | ||
hooks: | ||
- id: isort |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
======= | ||
Authors | ||
======= | ||
|
||
**Authors**: | ||
|
||
* Dario d'Andrea, [email protected] | ||
|
||
| | ||
**Contributors**: | ||
|
||
* Armand Valsesia, [email protected] | ||
* Jerome Carayol, [email protected] | ||
* Yves Lamonato, [email protected] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
========= | ||
Changelog | ||
========= | ||
|
||
Version 0.0.1 | ||
============= | ||
|
||
- Add design module | ||
- Add analysis module | ||
- Add visualization module for analysis | ||
- Add statistics module | ||
- Add planning module | ||
- Add docs |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Playtika Ltd. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
[comment]: <> (Modify also docs/installation.rst if change the README.md) | ||
[comment]: <> (Modify also LICENSE.rst if change the README.md) | ||
|
||
ABexp | ||
===== | ||
|
||
[comment]: <> (Modify also docs/badges.rst if you change the badges) | ||
[comment]: <> (Modify also LICENSE.rst if you change the license) | ||
![alt text](https://img.shields.io/badge/build-passing-brightgreen) | ||
![alt text](https://img.shields.io/badge/docs-passing-brightgreen) | ||
![alt text](https://img.shields.io/badge/coverage-95%25-green) | ||
![alt text](https://img.shields.io/badge/version-0.0.1-blue) | ||
![alt text](https://img.shields.io/badge/license-MIT-blue) | ||
|
||
**ABexp** is a ``Python`` library which aims to support users along the entire end-to-end A/B test experiment flow | ||
(see picture below). It contains A/B testing modules which use both frequentist and bayesian statistical approaches | ||
including bayesian generalized linear model (GLM). | ||
|
||
<br/> | ||
|
||
![A/B testing experiment flow](docs/img/experiment_flow.png) | ||
|
||
<br/> | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
This library is distributed on [PyPI](https://pypi.org/) and | ||
can be installed with ``pip``. The latest release is version ``0.0.1``. | ||
|
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
$ pip install abexp | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The command above will automatically install all the dependencies listed in ``requirements.txt``. Please visit the | ||
[installation](https://github.com/PlaytikaResearch/abexp) | ||
page for more details. | ||
|
||
<br/> | ||
|
||
Getting started | ||
--------------- | ||
A short example, illustrating it use: | ||
|
||
~~~~~~~~~~~~~~~ | ||
import abexp | ||
~~~~~~~~~~~~~~~ | ||
|
||
Compute the minimum sample size needed for an A/B test experiment with two variants, so called control and treatment | ||
groups. | ||
|
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
from abexp.core.design import SampleSize | ||
c = 0.33 # conversion rate control group | ||
t = 0.31 # conversion rate treatment group | ||
sample_size = SampleSize.ssd_prop(prop_contr=c, prop_treat=t) # minimum sample size per each group | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
<br/> | ||
|
||
Documentation | ||
------------- | ||
For more information please read the full | ||
[documentation](https://github.com/PlaytikaResearch/abexp) | ||
and | ||
[tutorials](https://github.com/PlaytikaResearch/abexp). | ||
|
||
<br/> | ||
|
||
Info for developers | ||
------------------- | ||
|
||
The source code of the project is available on [GitHub](https://github.com/PlaytikaResearch/abexp). | ||
|
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
$ git clone https://github.com/PlaytikaResearch/abexp.git | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
You can install the library and the dependencies with one of the following commands: | ||
|
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
$ pip install . # install library + dependencies | ||
$ pip install .[develop] # install library + dependencies + developer-dependencies | ||
$ pip install -r requirements.txt # install dependencies | ||
$ pip install -r requirements-dev.txt # install developer-dependencies | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
As suggested by the authors of ``pymc3`` and ``pandoc``, we highly recommend to install these dependencies with | ||
``conda``: | ||
|
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
$ conda install -c conda-forge pandoc | ||
$ conda install -c conda-forge pymc3 | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To create the file ``abexp.whl`` for the installation with ``pip`` run the following command: | ||
|
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
$ python setup.py sdist bdist_wheel | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To create the HTML documentation run the following commands: | ||
|
||
~~~~~~~~~~~ | ||
$ cd docs | ||
$ make html | ||
~~~~~~~~~~~ | ||
|
||
<br/> | ||
|
||
Run tests | ||
--------- | ||
|
||
Tests can be executed with ``pytest`` running the following commands: | ||
|
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
$ cd tests | ||
$ pytest # run all tests | ||
$ pytest test_testmodule.py # run all tests within a module | ||
$ pytest test_testmodule.py -k test_testname # run only 1 test | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
<br/> | ||
|
||
License | ||
------- | ||
|
||
[MIT License](LICENSE) |
Empty file.
Empty file.
Oops, something went wrong.