ambrosia

A Python library for working with A/B tests.


Keywords
ambrosia, ab, testing, split, experiment, design, groups, ab-testing, experiment-design, split-testing, statistical-inference, statistics
License
Apache-2.0
Install
pip install ambrosia==0.4.1

Documentation

Ambrosia

PyPI PyPI License ReadTheDocs Coverage Black Python Versions Telegram Channel

image

Ambrosia is a Python library for A/B tests design, split and effect measurement. It provides rich set of methods for conducting full A/B testing pipeline.

The project is intended for use in research and production environments based on data in pandas and Spark format.

Key functionality

  • Pilots design 🛫
  • Multi-group split 🎳
  • Matching of new control group to the existing pilot 🎏
  • Experiments result evaluation as p-value, point estimate of effect and confidence interval 🎞
  • Data preprocessing ✂️
  • Experiments acceleration 🎢

Documentation

For more details, see the Documentation and Tutorials.

Installation

You can always get the newest Ambrosia release using pip. Stable version is released on every tag to main branch.

pip install ambrosia 

Starting from version 0.4.0, the ability to process PySpark data is optional and can be enabled using pip extras during the installation.

pip install ambrosia[spark]

Usage

The main functionality of Ambrosia is contained in several core classes and methods, which are autonomic for each stage of an experiment and have very intuitive interface.

Below is a brief overview example of using a set of three classes to conduct some simple experiment.

Designer

from ambrosia.designer import Designer
designer = Designer(dataframe=df, effects=1.2, metrics='portfel_clc') # 20% effect, and loaded data frame df
designer.run('size') 

Splitter

from ambrosia.splitter import Splitter
splitter = Splitter(dataframe=df, id_column='id') # loaded data frame df with column with id - 'id'
splitter.run(groups_size=500, method='simple') 

Tester

from ambrosia.tester import Tester
tester = Tester(dataframe=df, column_groups='group') # loaded data frame df with groups info 'group'
tester.run(metrics='retention', method='theory', criterion='ttest')

Development

To install all requirements run

make install

You must have python3 and poetry installed.

For autoformatting run

make autoformat

For linters check run

make lint

For tests run

make test

For coverage run

make coverage

To remove virtual environment run

make clean

Authors

Developers and evangelists: