A User Parameter-free Bayesian Framework for Uplift Modeling
Project description
kuplift package
kuplift is a Python package that provides a series of uplift modeling methods based on recent research work. kuplift allows users to easily use the following algorithms:
-
Encoding data using a discretization method for treatment effect (uplift) modeling called UMODL.
-
OptimizedUnivariateEncoding is an optimized version of the umodl algorithm written in C++ for continuous and categorical variables.
-
Variable selection for uplift modeling with UMODL-FS.
-
Learning a Bayesian decision tree model for uplift modeling with UB-DT.
-
Learning a random forest model for uplift modeling with UB-RF.
How to install
$ pip install kuplift
User Guide
import kuplift as kp
import pandas as pd
df = pd.read_csv("data.csv")
# Make sure the dtype of all categorical variables is object
df = df.astype({"some_categorical_variable": object})
variables = list(df.columns[:-2]) # Last two columns are treatment and target columns
# Univariate variable transformation
ue = kp.UnivariateEncoding()
encoded_data = ue.fit_transform(df[variables], df["treatment"], df["target"])
# Univariate variable transformation optimized through the use of the C++ implementation of umodl
ue = kp.OptimizedUnivariateEncoding()
encoded_data = ue.fit_transform(df[variables], df["treatment"], df["target"])
# Feature selection
fs = kp.FeatureSelection()
important_vars = fs.filter(df[variables], df["treatment"], df["target"])
# Uplift Bayesian Decision Tree
tree = kp.BayesianDecisionTree()
tree.fit(df[variables], df["treatment"], df["target"])
preds = tree.predict(df[variables])
# Uplift Bayesian Random Forest
forest = kp.BayesianRandomForest(n_trees=4)
forest.fit(df[variables], df["treatment"], df["target"])
preds = forest.predict(df[variables])
Examples
You can find examples in the examples directory.
Documentation
Refer to the documentation at https://udata-orange.github.io/kuplift/
Credits
kuplift has been developed at Orange Labs.
Current contributors
Mina Rafla
Nicolas Voisine
References
Rafla, M., Voisine, N., Crémilleux, B., & Boullé, M. (2022, September). A non-parametric bayesian approach for uplift discretization and feature selection. ECML PKDD 2022
Rafla, M., Voisine, N., & Crémilleux, B. (2023, May). Parameter-free Bayesian decision trees for uplift modeling. PAKDD 2023
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kuplift-0.0.15.tar.gz.
File metadata
- Download URL: kuplift-0.0.15.tar.gz
- Upload date:
- Size: 72.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c81444081c65553d9a5d4a4ac4a8749704d6b6779b5e816f401fb83bbcd9073
|
|
| MD5 |
fc27f77cdd82daf5914b80fa91711f78
|
|
| BLAKE2b-256 |
f12288c5ebe9f2da58c609ec53cc0d930f32c85ba1b15dc2f2f41fa62ecca7f0
|
Provenance
The following attestation bundles were made for kuplift-0.0.15.tar.gz:
Publisher:
release-workflow.yml on UData-Orange/kuplift
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kuplift-0.0.15.tar.gz -
Subject digest:
7c81444081c65553d9a5d4a4ac4a8749704d6b6779b5e816f401fb83bbcd9073 - Sigstore transparency entry: 821199963
- Sigstore integration time:
-
Permalink:
UData-Orange/kuplift@252a8398d265b0d0e374158b5fab01fd911d34ed -
Branch / Tag:
refs/tags/v0.0.15 - Owner: https://github.com/UData-Orange
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-workflow.yml@252a8398d265b0d0e374158b5fab01fd911d34ed -
Trigger Event:
release
-
Statement type:
File details
Details for the file kuplift-0.0.15-py3-none-any.whl.
File metadata
- Download URL: kuplift-0.0.15-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8680dfd8785e41da3a27f637eeefcc51b50c856fdff8491f178c89ac27e01680
|
|
| MD5 |
68d30853ebbf82b118cc2492a7b079c3
|
|
| BLAKE2b-256 |
836200ecafcf27932c0a090984ca21fb61593090539b671bd7072b88360e8737
|
Provenance
The following attestation bundles were made for kuplift-0.0.15-py3-none-any.whl:
Publisher:
release-workflow.yml on UData-Orange/kuplift
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kuplift-0.0.15-py3-none-any.whl -
Subject digest:
8680dfd8785e41da3a27f637eeefcc51b50c856fdff8491f178c89ac27e01680 - Sigstore transparency entry: 821199973
- Sigstore integration time:
-
Permalink:
UData-Orange/kuplift@252a8398d265b0d0e374158b5fab01fd911d34ed -
Branch / Tag:
refs/tags/v0.0.15 - Owner: https://github.com/UData-Orange
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-workflow.yml@252a8398d265b0d0e374158b5fab01fd911d34ed -
Trigger Event:
release
-
Statement type: