πŸ“ˆπŸ” Lets Python do AB testing analysis

tlentali tlentali Last update: Dec 20, 2023

le_AB_logo

travis codecov bsd_3_license

le AB is a Python library for AB testing analysis.

⚑️ Quick start

Open In Colab

Before launching your AB test, you can compute the needed sample size per variation :

>>> from leab import before

>>> ab_test = before.leSample(conversion_rate=20,
...                           min_detectable_effect=2)
>>> ab_test.get_size_per_variation()

6347

After reaching the needed sample size, you can compare means obtained from A VS B :

>>> from leab import after
>>> from leab import leDataset

>>> data = leDataset.SampleLeAverage()

>>> ab_test = after.leAverage(data.A, data.B)
>>> teab_testst.get_verdict()

'Sample A mean is greater'

πŸ›  Installation

🐍 You need to install Python 3.6 or above.

Installation can be done by using pip.
There are wheels available for Linux, MacOS, and Windows.

pip install leab

You can also install the latest development version as so:

pip install git+https://github.com/tlentali/leab

# Or, through SSH:
pip install git+ssh://[email protected]/tlentali/leab.git

πŸ₯„ Philosophy

"Life is a sum of all our choices."
Albert Camus

Get ready to take a decision !

AB testing has never been more popular, especially on Internet based companies.
Even if each test is unique, some questions seem to be asked again and again :

  • when is my test going to be statistically significant ?
  • is A more successful than B ?
  • does A generate more than B ?

Strong statistical knowledge are required to handle it from start to end correctly.
To answer those questions in a simple and robust way, we built le AB.
Lets Python do AB testing analysis !

πŸ”₯ Features

Here are some benefits of using Le AB :

  • Sample size : How many subjects are needed for my AB test ?
  • Test duration : How many days are needed for my AB test ?
  • Rate of success : Does the rate of success differ across two groups ?
  • Average value : Does the average value differ across two groups ?
  • html auto-report : Generate a html report (example) for the sample size part.

Next release features :

  • html auto-report : Generate a html report for the after part.
  • sequential sampling : How many conversions are needed for a sequential AB test ?

πŸ”— Useful links

πŸ™ Thanks

This project takes its inspiration from Evan Miller great work, especially the following :

Thank you so much Evan M. for your work, it saved our lives so many times !

A big thanks to Max Halford too, who inspired us in the structure of this project, particularly for docs and tests.
Have a look at Creme-ml, it's just amazingly done !

To finish, thanks to all of you who use or are going to use this lib, hope it helps !

πŸ–– Contributing

Feel free to contribute in any way you like, we're always open to new ideas and approaches. If you want to contribute to the code base please check out the CONTRIBUTING.md file. Also take a look at the issue tracker and see if anything takes your fancy.

This project follows the all-contributors specification. Again, contributions of any kind are welcome!

tlentali
tlentali

πŸ“† πŸ’»
JLouedec
JLouedec

πŸ“
RomainSa
RomainSa

πŸ“

πŸ“œ License

le AB is free and open-source software licensed under the 3-clause BSD license.

Subscribe to our newsletter