Skip to main content

A Python library for working with A/B tests.

Project description

PyPI PyPI License ReadTheDocs Tests Coverage Black Python Versions Telegram Channel

https://raw.githubusercontent.com/MobileTeleSystems/Ambrosia/main/docs/source/_static/ambrosia.png

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

Requirements: Python 3.9+

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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ambrosia-0.5.2.tar.gz (90.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ambrosia-0.5.2-py3-none-any.whl (127.2 kB view details)

Uploaded Python 3

File details

Details for the file ambrosia-0.5.2.tar.gz.

File metadata

  • Download URL: ambrosia-0.5.2.tar.gz
  • Upload date:
  • Size: 90.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1015-azure

File hashes

Hashes for ambrosia-0.5.2.tar.gz
Algorithm Hash digest
SHA256 c859bf0a75aea0ce01937fffac18058ab9e89cc1f588fb73f53d0f05071e0f13
MD5 9590e4182af1d7846a672de5cdfb1c8e
BLAKE2b-256 809fe83a8ad7596668fc3a31a75ad2359d3e22daf1e5827fa815ecc3ad1d97fe

See more details on using hashes here.

File details

Details for the file ambrosia-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: ambrosia-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 127.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Linux/6.17.0-1015-azure

File hashes

Hashes for ambrosia-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c4bea6279fb39fe2e0a43e84cf4375e7952c65e0b267211e1c3cd2e8147a87bf
MD5 f96cf0ea45cc9429ce46a1a1e09ec7ca
BLAKE2b-256 d89695b16bd35e40327492ab0e6af8727184c2755aa507a2c1a30e984b23deb1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page