Skip to content

Alfa-Advanced-Analytics/auf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Automatic Uplift Framework (AUF)

AutoML library for automatic uplift modeling


Table of Contents

  1. Description
  2. Key Features
  3. Installation
  4. Quick Start
  5. Project Structure
  6. License

Description

AUF (Automatic Uplift Framework) is an AutoML library that provides a complete pipeline for building uplift models. The library automates all stages: data validation, statistical significance testing of treatment effects, feature selection and ranking, model training (S-, T-, X-learners, uplift trees and forests), optimal model selection, and generation of detailed quality analytics with visualization.

AUF supports multi-treatment and integrates with MLflow for experiment tracking, making it an ideal tool for rapid prototyping and production-ready solutions in personalized interventions.


Key Features

  • Complete AutoML pipeline from raw data to production-ready model
  • Statistical effect validation via bootstrap significance testing
  • Automatic feature selection with 5 possible ranking strategies (filters, importance, permutation, stepwise selection)
  • Support for all major uplift methods: S-Learner, X-Learner, uplift trees, random forest
  • Comprehensive visualization: Qini curves, uplift curves, conversion by buckets, discrete and continuous plots
  • MLflow integration for automatic logging of metrics, artifacts, and models
  • Multi-treatment support

Installation

Standard installation from PyPI:

# Create a new virtual environment (highly recommended)
conda create -n auf_env python=3.8 -y
conda activate auf_env

# Install AUF
pip install auf

Installation from source:

git clone https://github.com/Alfa-Advanced-Analytics/auf.git
cd auf
pip install -e .

Quick Start

from auf.pipeline import UpliftPipeline

# Initialize pipeline
pipeline = UpliftPipeline(
    print_doc=False,
    task_name_mlflow='test_auf',
    run_description='Testing AUF library',
)

# Load data with ID, target, treatment, features columns
df = load_your_data()

# Map unified base columns names into user base columns names
base_cols_mapper = {
    'id': "id",
    'treatment': 'treatment',
    'target': 'target',
    'segm': None
}

# Map treatment groups names into unified ones (0 and 1)
treatment_groups_mapper = {
    "control": 0,
    "treatment": 1
}

# Load data in the pipeline
pipeline.load_sample(
    df,
    base_cols_mapper,
    treatment_groups_mapper
)

# Run full pipeline
pipeline.run()

# All results are:
# 1) saved to MLflow (if configured)
# 2) plotted by pipeline during its work

Important: DataFrame df must be pre-formatted with column names for ID, target, and treatment specified via mapping dictionaries.


Project Structure

auf/  
β”œβ”€β”€ __init__.py  
β”œβ”€β”€ constants/  
β”‚   β”œβ”€β”€ # Predefined metrics and parameters  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   β”œβ”€β”€ metrics.py  
β”‚   └── numbers.py  
β”œβ”€β”€ data/  
β”‚   β”œβ”€β”€ # Data validation and preprocessing  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   β”œβ”€β”€ checks.py  
β”‚   β”œβ”€β”€ preprocessing.py  
β”‚   └── split.py  
β”œβ”€β”€ feature_rankers/  
β”‚   β”œβ”€β”€ # Feature ranking strategies  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   β”œβ”€β”€ filter.py  
β”‚   β”œβ”€β”€ importance.py  
β”‚   β”œβ”€β”€ permutation.py  
β”‚   β”œβ”€β”€ stepwise.py  
β”‚   └── straightforward.py  
β”œβ”€β”€ log/  
β”‚   β”œβ”€β”€ # Logging and progress tracking  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   └── log.py  
β”œβ”€β”€ metrics/  
β”‚   β”œβ”€β”€ # Custom uplift metrics  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   β”œβ”€β”€ averaged.py  
β”‚   β”œβ”€β”€ by_top.py  
β”‚   └── overfit.py  
β”œβ”€β”€ ml_flow/  
β”‚   β”œβ”€β”€ # MLflow integration  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   └── ml_flow.py  
β”œβ”€β”€ models/  
β”‚   β”œβ”€β”€ # Uplift model implementations  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   β”œβ”€β”€ auf_forest.py  
β”‚   β”œβ”€β”€ auf_model.py  
β”‚   β”œβ”€β”€ auf_tree.py  
β”‚   └── auf_x_learner.py  
β”œβ”€β”€ pipeline/  
β”‚   β”œβ”€β”€ # Main pipeline and components  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   β”œβ”€β”€ calibration.py  
β”‚   β”œβ”€β”€ evaluation.py  
β”‚   β”œβ”€β”€ inference.py  
β”‚   └── pipeline.py  
β”œβ”€β”€ plots/  
β”‚   β”œβ”€β”€ # Result visualization  
β”‚   β”œβ”€β”€ __init__.py  
β”‚   └── plots.py  
└── training/  
    β”œβ”€β”€ # Training and optimization  
    β”œβ”€β”€ __init__.py  
    β”œβ”€β”€ fitting.py  
    β”œβ”€β”€ gridsearch.py  
    └── model_generation.py  

License

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

About

Automatic Uplift Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages