Skip to main content

Python3 PyPi Total PyPI downloads Docs License

scikit-uplift: uplift modeling in scikit-learn style in python

scikit-uplift

scikit-uplift (sklift) is an uplift modeling python package that provides fast sklearn-style models implementation, evaluation metrics and visualization tools.

Uplift modeling estimates a causal effect of treatment and uses it to effectively target customers that are most likely to respond to a marketing campaign.

Use cases for uplift modeling:

  • Target customers in the marketing campaign. Quite useful in promotion of some popular product where there is a big part of customers who make a target action by themself without any influence. By modeling uplift you can find customers who are likely to make the target action (for instance, install an app) only when treated (for instance, received a push).

  • Combine a churn model and an uplift model to offer some bonus to a group of customers who are likely to churn.

  • Select a tiny group of customers in the campaign where a price per customer is high.

Read more about uplift modeling problem in User Guide.

Articles in russian on habr.com: Part 1 , Part 2 and Part 3.

Why sklift

  • Сomfortable and intuitive scikit-learn-like API;

  • More uplift metrics than you have ever seen in one place! Include brilliants like Area Under Uplift Curve (AUUC) or Area Under Qini Curve (Qini coefficient) with ideal cases;

  • Supporting any estimator compatible with scikit-learn (e.g. Xgboost, LightGBM, Catboost, etc.);

  • All approaches can be used in the sklearn.pipeline. See the example of usage on the Tutorials page;

  • Also metrics are compatible with the classes from sklearn.model_selection. See the example of usage on the Tutorials page;

  • Almost all implemented approaches solve classification and regression problems;

  • Nice and useful viz for analysing a performance model.

Installation

This version requires Python 3.11 or later. To install from PyPI:

python -m pip install scikit-uplift

Or install from source:

git clone https://github.com/maks-sh/scikit-uplift.git
cd scikit-uplift
python -m pip install .

Documentation

The full documentation is available at uplift-modeling.com.

Or you can build the documentation locally using Sphinx 1.4 or later:

cd docs
pip install -r requirements.txt
make html

And if you now point your browser to _build/html/index.html, you should see a documentation site.

Quick Start

See the RetailHero tutorial notebook (EN Open In Colab1, RU Open In Colab2) for details.

Train and predict uplift model

Use the intuitive python API to train uplift models with sklift.models.

# import approaches
from sklift.models import SoloModel, ClassTransformation
# import any estimator adheres to scikit-learn conventions.
from lightgbm import LGBMClassifier

# define models
estimator = LGBMClassifier(n_estimators=10)

# define metamodel
slearner = SoloModel(estimator=estimator)

# fit model
slearner.fit(
    X=X_tr,
    y=y_tr,
    treatment=trmnt_tr,
)

# predict uplift
uplift_slearner = slearner.predict(X_val)

Evaluate your uplift model

Uplift model evaluation metrics are available in sklift.metrics.

# import metrics to evaluate your model
from sklift.metrics import (
    uplift_at_k, uplift_auc_score, qini_auc_score, weighted_average_uplift
)


# Uplift@30%
uplift_at_k = uplift_at_k(y_true=y_val, uplift=uplift_slearner,
                          treatment=trmnt_val,
                          strategy='overall', k=0.3)

# Area Under Qini Curve
qini_coef = qini_auc_score(y_true=y_val, uplift=uplift_slearner,
                           treatment=trmnt_val)

# Area Under Uplift Curve
uplift_auc = uplift_auc_score(y_true=y_val, uplift=uplift_slearner,
                              treatment=trmnt_val)

# Weighted average uplift
wau = weighted_average_uplift(y_true=y_val, uplift=uplift_slearner,
                              treatment=trmnt_val)

Vizualize the results

Visualize performance metrics with sklift.viz.

from sklift.viz import plot_qini_curve
import matplotlib.pyplot as plt

fig, ax = plt.subplots(1, 1)
ax.set_title('Qini curves')

plot_qini_curve(
    y_test, uplift_slearner, trmnt_test,
    perfect=True, name='Slearner', ax=ax
);

plot_qini_curve(
    y_test, uplift_revert, trmnt_test,
    perfect=False, name='Revert label', ax=ax
);
Example of some models qini curves, perfect qini curve and random qini curve

Development

We welcome new contributors of all experience levels.

Thanks to all our contributors!

Contributors

If you have any questions, please contact us at team@uplift-modeling.com


Papers and materials

  1. Gutierrez, P., & Gérardy, J. Y.

    Causal Inference and Uplift Modelling: A Review of the Literature. In International Conference on Predictive Applications and APIs (pp. 1-13).

  2. Artem Betlei, Criteo Research; Eustache Diemert, Criteo Research; Massih-Reza Amini, Univ. Grenoble Alpes

    Dependent and Shared Data Representations improve Uplift Prediction in Imbalanced Treatment Conditions FAIM’18 Workshop on CausalML.

  3. Eustache Diemert, Artem Betlei, Christophe Renaudin, and Massih-Reza Amini. 2018.

    A Large Scale Benchmark for Uplift Modeling. In Proceedings of AdKDD & TargetAd (ADKDD’18). ACM, New York, NY, USA, 6 pages.

  4. Athey, Susan, and Imbens, Guido. 2015.

    Machine learning methods for estimating heterogeneous causal effects. Preprint, arXiv:1504.01132. Google Scholar.

  5. Oscar Mesalles Naranjo. 2012.

    Testing a New Metric for Uplift Models. Dissertation Presented for the Degree of MSc in Statistics and Operational Research.

  6. Kane, K., V. S. Y. Lo, and J. Zheng. 2014.

    Mining for the Truly Responsive Customers and Prospects Using True-Lift Modeling: Comparison of New and Existing Methods. Journal of Marketing Analytics 2 (4): 218–238.

  7. Maciej Jaskowski and Szymon Jaroszewicz.

    Uplift modeling for clinical trial data. ICML Workshop on Clinical Data Analysis, 2012.

  8. Lo, Victor. 2002.

    The True Lift Model - A Novel Data Mining Approach to Response Modeling in Database Marketing. SIGKDD Explorations. 4. 78-86.

  9. Zhao, Yan & Fang, Xiao & Simchi-Levi, David. 2017.

    Uplift Modeling with Multiple Treatments and General Response Types. 10.1137/1.9781611974973.66.

  10. Nicholas J Radcliffe. 2007.

    Using control groups to target on predicted lift: Building and assessing uplift model. Direct Marketing Analytics Journal, (3):14–21, 2007.

  11. Devriendt, F., Guns, T., & Verbeke, W. 2020.

    Learning to rank for uplift modeling. ArXiv, abs/2002.05897.


Tags

EN: uplift modeling, uplift modelling, causal inference, causal effect, causality, individual treatment effect, true lift, net lift, incremental modeling

RU: аплифт моделирование, Uplift модель

ZH: uplift增量建模, 因果推断, 因果效应, 因果关系, 个体干预因果效应, 真实增量, 净增量, 增量建模

Metadata

Release files for scikit-uplift 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scikit-uplift 0.6.0
File Size Uploaded Provenance Actions
scikit_uplift-0.6.0.tar.gz 43.8 kB With provenance Details for scikit_uplift-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scikit-uplift 0.6.0
File Interpreter ABI Platform Actions
scikit_uplift-0.6.0-py3-none-any.whl Python 3 none any Details for scikit_uplift-0.6.0-py3-none-any.whl

Total release size: 89.2 kB

Release files / scikit_uplift-0.6.0.tar.gz

Download URL scikit_uplift-0.6.0.tar.gz
Size 43.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0b5d19919c26725ffdba0035f04fa0e2d373aadfcf571fb2a407dbc2b69ddc48
BLAKE2b-256 checksum
How to use checksums
b1c8fff68f747abb8f9d2032518150216b56708d37a9a25ba320ed880c8594b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / scikit_uplift-0.6.0-py3-none-any.whl

Download URL scikit_uplift-0.6.0-py3-none-any.whl
Size 45.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b270d60965c82bc64a206662dc3e8bfdcb6353f46bd3dfe9aac07ed7cdc2d25a
BLAKE2b-256 checksum
How to use checksums
0d02be56ad2386c67a4373d85e35886d36c7ae8642f99fcefe64a049fa3fa9de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for scikit-uplift 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scikit_uplift-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page