Skip to main content

A package for streamlining the design, analysis, and decision-making of A/B tests

Project description

ablisk

This module aims to make it easier for data scientists, analysts, and engineers to conduct statistically sound experiments. At its core is the ABLisk class. This class provides tools for designing, analyzing, and simulating A/B tests.


Features

  • Sample Size Calculation: Calculate the minimum required sample size.
  • Result Analysis: Retrieve and visualize experiment results with support for confidence intervals and kernel density estimates (KDEs).
  • Recommendation: Generate results summary and recommendations based os results.

Class Overview

ABLisk

The main class provides the following methods and attributes:

Initialization

ABLisk(bcr, mde, alpha = 0.05, power = 0.8, is_absolute_variation: bool = True, is_two_tailed: bool = True)
  • bcr: Baseline Conversion Rate (0 <= mde < 1).
  • mde: Minimum Detectable Effect (absolute or relative) (0 < mde < 1).
  • alpha: Significance level (default: 0.05).
  • power: Statistical power (default: 0.8).
  • is_absolute_variation: Whether mde is absolute (default: True).
  • ** is_two_tailed**: Use two-tailed tests (default: True).

Methods

  1. get_sample_size()

    • Calculates the minimum required sample size.
  2. get_experiment_results(n_ctrl, p_ctrl, n_trmt, p_trmt, plot_type = 'KDE')

    • Analyzes and visualizes results.
    • Parameters:
      • n_ctrl, n_trmt: Sample sizes of the control and treatment groups.
      • p_ctrl, p_trmt: Conversion rates for control and treatment groups.
      • plot_type: for visualization('KDE' or 'Confidence Intervals') or results summary and recommendations (None).

Usage

Installation

pip install ablisk

Importing the module

from ablisk import ABLisk

Example: Calculate Sample Size

ab_test = ABLisk(bcr = 0.1, mde = 0.02, alpha = 0.05, power = 0.8)
sample_size = ab_test.get_sample_size()
print(f"Required Sample Size: {sample_size}")

Example: Visualize Experiment Results

ab_test.get_experiment_results(n_ctrl = 500, p_ctrl = 0.1, n_trmt = 500, p_trmt = 0.12, plot_type = 'Confidence Intervals')

💡 A more detailed example regarding the implementation of this tool is available on its respective notebook. You can view the notebook using nbviewer due to GitHub rendering limitations here.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Contribution

Contributions are welcome! Please fork the repository, create a feature branch, and submit a pull request.


References


Acknowledgments

This project would not be possible without the massive contribution of Evan Miller regarding A/B testing methodologies and tools. Refer to his A/B Testing Sample Size Calculator for further details.


Explore the Web App 🌐🚀

ablisk is the statistical engine of xplendid – the AI-assisted web application version for this module.

Networking

Connect with me:

/domingosdeeulariadumba

/domingosdeeulariadumba

/domingosdeeulariadumba

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

ablisk-0.1.9.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

ablisk-0.1.9-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file ablisk-0.1.9.tar.gz.

File metadata

  • Download URL: ablisk-0.1.9.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for ablisk-0.1.9.tar.gz
Algorithm Hash digest
SHA256 30a72abd6b248d8ee1a542f49f63b6b8dbbef48875658f9a47c2e729770c97a7
MD5 70a2dbe6471646583053c62b5c087b4b
BLAKE2b-256 7c32f981b10f6dbb8362fbb5d0cd76f0dbaa2336a19c8437dd67c8675d4b6d24

See more details on using hashes here.

File details

Details for the file ablisk-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: ablisk-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for ablisk-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 bfd0ff04f6336ff0f797430163ee94cec3b383cfed014c7511d0db8f13270aca
MD5 c23216c073098fbe0577afbfcdf503e2
BLAKE2b-256 8f78f5227396b2bc5546a3771c73687d91a98dcc6651c4c4f72e8a2b6f47703d

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