Skip to main content

AB tests library with simplicity in mind

Project description

ABOBA

AB tests library with simplicity in mind

📚 Documentation

✨ Features

  • Simple & Intuitive API - Easy to learn and use for both beginners and experts
  • Multiple Statistical Tests - t-tests, ANOVA, Kruskal-Wallis, and more
  • Variance Reduction - Built-in CUPED, stratification, and regression adjustments
  • Power Analysis - Simulate synthetic effects to estimate required sample sizes
  • Flexible Pipelines - Chain data processors and samplers for complex workflows
  • Experiment Orchestration - Run and visualize multiple test scenarios simultaneously
  • Extensible Architecture - Easy to create custom tests, samplers, and processors
  • Production Ready - Type hints, comprehensive tests, and detailed documentation

🚀 Quick Start

Installation

pip install aboba

📖 Quick Example

To conduct a test, you need several entities:

  • data
  • data processing
  • data sampling technique
  • the test strategy itself

Data can be a simple pandas dataframe or custom data generator.

General use case

import numpy as np
import pandas as pd
import scipy.stats as sps

from aboba import (
    tests,
    samplers,
    effect_modifiers,
    experiment,
)
from aboba.pipeline import Pipeline

# Create dataset with two groups
data = pd.DataFrame({
    'value'  : np.concatenate([
        sps.norm.rvs(size=1000, loc=0, scale=1),
        sps.norm.rvs(size=1000, loc=0, scale=1),
    ]),
    'is_b_group': np.concatenate([
        np.repeat(0, 1000),
        np.repeat(1, 1000),
    ]),
})

# Configure test
test = tests.AbsoluteIndependentTTest(
    value_column='value',
)

# Create pipeline with sampler
sampler = samplers.GroupSampler(
    column='is_b_group',
    size=100,
)
pipeline = Pipeline([
    ('sampler', sampler),
])

# Run experiment
n_iter = 500
exp = experiment.AbobaExperiment(draw_cols=1)

group_aa = exp.group(
    name="AA, regular",
    test=test,
    data=data,
    data_pipeline=pipeline,
    n_iter=n_iter
)
group_aa.run()

effect = effect_modifiers.GroupModifier(
    effects={1: 0.3},
    value_column='value',
    group_column='is_b_group',
)

group_ab = exp.group(
    name="AB, regular, effect=0.3",
    test=test,
    data=data,
    data_pipeline=pipeline,
    synthetic_effect=effect,
    n_iter=n_iter
)
group_ab.run()

# Draw results
fig, axes = exp.draw()
fig.savefig('results.png')

🎯 Key Components

  • Tests - Statistical tests for hypothesis testing (t-tests, ANOVA, etc.)
  • Samplers - Control how data is split into groups (random, stratified, grouped)
  • Processors - Transform data before testing (CUPED, bucketing, normalization)
  • Pipelines - Chain multiple processors and samplers together
  • Effect Modifiers - Simulate synthetic effects for power analysis
  • Experiments - Orchestrate multiple test runs and visualize results

📊 Use Cases

  • A/B Testing - Compare two variants to determine which performs better
  • Multivariate Testing - Test multiple variants simultaneously
  • Power Analysis - Determine required sample sizes for detecting effects
  • Variance Reduction - Use CUPED or stratification to improve test sensitivity
  • Custom Tests - Implement domain-specific statistical tests

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT License - see LICENSE file for details

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

aboba-1.0.7.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

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

aboba-1.0.7-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file aboba-1.0.7.tar.gz.

File metadata

  • Download URL: aboba-1.0.7.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for aboba-1.0.7.tar.gz
Algorithm Hash digest
SHA256 082722437bf4dce2d588ccc8614bbf6d2e8630307b4519bc42d1560f0c20802d
MD5 9ed6e459478c78bb2e3decb84fe43012
BLAKE2b-256 00121b62bb083cc783d961481b97a98506c572936495c191d04e3012d9661f95

See more details on using hashes here.

File details

Details for the file aboba-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: aboba-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for aboba-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6cfeb8a1ac869d5202a91a5e01ebae22d4855b7ff9f2988a53444291751bb978
MD5 0d3b211510693c9d968539a1386b2ca1
BLAKE2b-256 d13a62c9e3247ad6e3cbe812bef461a97b934263f3b5af1ca3da6cc64aa0af13

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