BEAT: A Python Package for ML-Based Heterogeneous Treatment Effects Estimation
BEAT is a Python package for estimating heterogeneous treatment effects from observational data via machine learning:
- All arguments are the same as the original package, but there are two new inputs: target.weight.penalty indicates the penalty assigned to the protected attributes. target.weights is a matrix that includes the protected characteristics. X should not inlcude the protected characteristics.
- See full details about the BEAT method in the original paper: Eliminating unintended bias in personalized policies using bias-eliminating adapted trees (BEAT)
- Forked from https://github.com/Microsoft/EconML
Getting Started
Installation
Install the latest release from PyPI:
pip install BEAT_TEST
Usage Examples
Estimation Methods
from econml.grf import BeatForest
#Setting Training treatment and outcome
treatment = ['W']
outcome = ['Y']
Y = train[outcome]
T = train[treatment]
#Setting Unprotected variables
unprotected_covariate = ['X.V1', 'X.V2', 'X.V3', 'X.V4', 'X.V5', 'Z.V1', 'Z.V2', 'Z.V3', 'Z.V4']
X1 = train[unprotected_covariate]
#set parameters for BEAT and Fit in training values
BEAT = BeatForest(alpha = 10, demean = 0, n_estimators = 8)
BEAT.fit(X1, T, Y)
#Get prediction from test dataset
prediction = BEAT.predict(X_test)
References
Ascarza, E., & Israeli, A. (2022). Eliminating unintended bias in personalized policies using bias-eliminating adapted trees (beat). Proceedings of the National Academy of Sciences, 119(11). https://doi.org/10.1073/pnas.2115293119
Metadata
Release files for Beat-ML1 0.13.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Beat_ML1-0.13.1.tar.gz | 1.4 MB | Without provenance | Details for Beat_ML1-0.13.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Beat_ML1-0.13.1-cp38-cp38-macosx_10_9_x86_64.whl | CPython 3.8 | CPython 3.8 | macOS 10.9+ x86-64 | Details for Beat_ML1-0.13.1-cp38-cp38-macosx_10_9_x86_64.whl |
Total release size: 2.4 MB
Release files / Beat_ML1-0.13.1.tar.gz
| Download URL | Beat_ML1-0.13.1.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c03be041e6a6b1607afb54541ace925cd5b2dbe84199be4b51816925d9a29ab5
|
|
BLAKE2b-256 checksum How to use checksums |
c1a9279c1edc98e790411888964733e2d3b3502cc9d4a697b89f1af35c73b398
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.3
|
Release files / Beat_ML1-0.13.1-cp38-cp38-macosx_10_9_x86_64.whl
| Download URL | Beat_ML1-0.13.1-cp38-cp38-macosx_10_9_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.8 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
65168cd945626f5ffd8101ec8f2de9a8306f99f67f7c8b8d531b988f6d9b87dc
|
|
BLAKE2b-256 checksum How to use checksums |
db563cbef4fc10aece39b4b43c7bcbf5d80429ff34aed7dd18302eb954033c0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.3
|
Security for Beat-ML1 0.13.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.