MetaLearners for CATE estimation
Project description
metalearners
MetaLearners for Conditional Average Treatment Effect (CATE) estimation
The library focuses on providing
- Methodologically sound cross-fitting
- Convenient access to and reuse of base models
- Consistent APIs across Metalearners
- Support for more than binary treatment variants
- Integrations with
pandas,shap,lime,optunaand soononnx
Example
df = ...
from metalearners import RLearner
from lightgbm import LGBMClassifier, LGBMRegressor
rlearner = RLearner(
nuisance_model_factory=LGBMRegressor,
propensity_model_factory=LGBMClassifier,
treatment_model_factory=LGBMRegressor,
is_classification=False,
n_variants=2,
)
features = ["age", "weight", "height"]
rlearner.fit(df[features], df["outcomes"], df["treatment"])
cate_estimates = rlearner.predict(df[features], is_oos=False)
Please refer to our docs for many more in-depth and reproducible examples.
Installation
metalearners can either be installed via PyPI with
$ pip install metalearners
or via conda-forge with
$ conda install metalearners -c conda-forge
Development
Development instructions can be found here.
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 metalearners-0.13.0.tar.gz.
File metadata
- Download URL: metalearners-0.13.0.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88477130c8828c607042fed07dde710d8066664f74f7f8f20c075b021ac97c58
|
|
| MD5 |
2fd7cb17b2744858655b80f4528fa70e
|
|
| BLAKE2b-256 |
e079a194a57e56cbd4d5e3eb542b6b315524326e43563a4550cb16012f4ab12d
|
Provenance
The following attestation bundles were made for metalearners-0.13.0.tar.gz:
Publisher:
package.yml on Quantco/metalearners
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metalearners-0.13.0.tar.gz -
Subject digest:
88477130c8828c607042fed07dde710d8066664f74f7f8f20c075b021ac97c58 - Sigstore transparency entry: 241174096
- Sigstore integration time:
-
Permalink:
Quantco/metalearners@7c6a4f4e18819b2e3202f85d124ec16b9bc96de1 -
Branch / Tag:
refs/tags/0.13.0 - Owner: https://github.com/Quantco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@7c6a4f4e18819b2e3202f85d124ec16b9bc96de1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file metalearners-0.13.0-py3-none-any.whl.
File metadata
- Download URL: metalearners-0.13.0-py3-none-any.whl
- Upload date:
- Size: 62.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a260cecd9da2529ac5eaadeb5fda037c79815afc03e84c92f409f7a11488fccd
|
|
| MD5 |
31802bd1fba900814c899a4ec1b7792b
|
|
| BLAKE2b-256 |
d7b7c6de1c2ef9c17d7824e78b639439f5957506b094e2b19edce9cc1d9d0bb4
|
Provenance
The following attestation bundles were made for metalearners-0.13.0-py3-none-any.whl:
Publisher:
package.yml on Quantco/metalearners
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metalearners-0.13.0-py3-none-any.whl -
Subject digest:
a260cecd9da2529ac5eaadeb5fda037c79815afc03e84c92f409f7a11488fccd - Sigstore transparency entry: 241174102
- Sigstore integration time:
-
Permalink:
Quantco/metalearners@7c6a4f4e18819b2e3202f85d124ec16b9bc96de1 -
Branch / Tag:
refs/tags/0.13.0 - Owner: https://github.com/Quantco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@7c6a4f4e18819b2e3202f85d124ec16b9bc96de1 -
Trigger Event:
release
-
Statement type: