Skip to content

Commit

Permalink
Merge branch 'main' into onnx
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescMartiEscofetQC authored Jul 4, 2024
2 parents a25cac6 + 274f40b commit 43c3e69
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,41 @@
[![PypiVersion](https://img.shields.io/pypi/v/metalearners.svg?logo=pypi&logoColor=white)](https://pypi.org/project/metalearners)
[![codecov.io](https://codecov.io/github/QuantCo/metalearners/coverage.svg?branch=main)](https://codecov.io/github/QuantCo/metalearners?branch=main)

MetaLearners for CATE estimation
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`, `optuna` and soon `onnx`

## Example

```python

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["treatment"], df["outcomes"])
cate_estimates = rlearner.predict(df[features], is_oos=False)
```

Please refer to our
[docs](https://metalearners.readthedocs.io/en/latest/?badge=latest)
for many more in-depth and reproducible examples.

## Installation

Expand Down

0 comments on commit 43c3e69

Please sign in to comment.