Skip to main content

Python Package for Uplift Modeling and Causal Inference with Machine Learning Algorithms

Project description


PyPI Version Build Status Documentation Status Downloads CII Best Practices

Disclaimer

This project is stable and being incubated for long-term support. It may contain new experimental code, for which APIs are subject to change.

Causal ML: A Python Package for Uplift Modeling and Causal Inference with ML

Causal ML is a Python package that provides a suite of uplift modeling and causal inference methods using machine learning algorithms based on recent research [1]. It provides a standard interface that allows user to estimate the Conditional Average Treatment Effect (CATE) or Individual Treatment Effect (ITE) from experimental or observational data. Essentially, it estimates the causal impact of intervention T on outcome Y for users with observed features X, without strong assumptions on the model form. Typical use cases include

  • Campaign targeting optimization: An important lever to increase ROI in an advertising campaign is to target the ad to the set of customers who will have a favorable response in a given KPI such as engagement or sales. CATE identifies these customers by estimating the effect of the KPI from ad exposure at the individual level from A/B experiment or historical observational data.

  • Personalized engagement: A company has multiple options to interact with its customers such as different product choices in up-sell or messaging channels for communications. One can use CATE to estimate the heterogeneous treatment effect for each customer and treatment option combination for an optimal personalized recommendation system.

Documentation

Documentation is available at:

https://causalml.readthedocs.io/en/latest/about.html

Installation

Installation instructions are available at:

https://causalml.readthedocs.io/en/latest/installation.html

Quickstart

Quickstarts with code-snippets are available at:

https://causalml.readthedocs.io/en/latest/quickstart.html

Example Notebooks

Example notebooks are available at:

https://causalml.readthedocs.io/en/latest/examples.html

Contributing

We welcome community contributors to the project. Before you start, please read our code of conduct and check out contributing guidelines first.

Versioning

We document versions and changes in our changelog.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

References

Documentation

Workshops, Talks, and Publications

Citation

To cite CausalML in publications, you can refer to the following sources:

Whitepaper: CausalML: Python Package for Causal Machine Learning

Bibtex:

@misc{chen2020causalml, title={CausalML: Python Package for Causal Machine Learning}, author={Huigang Chen and Totte Harinen and Jeong-Yoon Lee and Mike Yung and Zhenyu Zhao}, year={2020}, eprint={2002.11631}, archivePrefix={arXiv}, primaryClass={cs.CY} }

Literature

  1. Chen, Huigang, Totte Harinen, Jeong-Yoon Lee, Mike Yung, and Zhenyu Zhao. "Causalml: Python package for causal machine learning." arXiv preprint arXiv:2002.11631 (2020).
  2. Radcliffe, Nicholas J., and Patrick D. Surry. "Real-world uplift modelling with significance-based uplift trees." White Paper TR-2011-1, Stochastic Solutions (2011): 1-33.
  3. Zhao, Yan, Xiao Fang, and David Simchi-Levi. "Uplift modeling with multiple treatments and general response types." Proceedings of the 2017 SIAM International Conference on Data Mining. Society for Industrial and Applied Mathematics, 2017.
  4. Hansotia, Behram, and Brad Rukstales. "Incremental value modeling." Journal of Interactive Marketing 16.3 (2002): 35-46.
  5. Jannik Rößler, Richard Guse, and Detlef Schoder. "The Best of Two Worlds: Using Recent Advances from Uplift Modeling and Heterogeneous Treatment Effects to Optimize Targeting Policies". International Conference on Information Systems (2022)
  6. Su, Xiaogang, et al. "Subgroup analysis via recursive partitioning." Journal of Machine Learning Research 10.2 (2009).
  7. Su, Xiaogang, et al. "Facilitating score and causal inference trees for large observational studies." Journal of Machine Learning Research 13 (2012): 2955.
  8. Athey, Susan, and Guido Imbens. "Recursive partitioning for heterogeneous causal effects." Proceedings of the National Academy of Sciences 113.27 (2016): 7353-7360.
  9. Künzel, Sören R., et al. "Metalearners for estimating heterogeneous treatment effects using machine learning." Proceedings of the national academy of sciences 116.10 (2019): 4156-4165.
  10. Nie, Xinkun, and Stefan Wager. "Quasi-oracle estimation of heterogeneous treatment effects." arXiv preprint arXiv:1712.04912 (2017).
  11. Bang, Heejung, and James M. Robins. "Doubly robust estimation in missing data and causal inference models." Biometrics 61.4 (2005): 962-973.
  12. Van Der Laan, Mark J., and Daniel Rubin. "Targeted maximum likelihood learning." The international journal of biostatistics 2.1 (2006).
  13. Kennedy, Edward H. "Optimal doubly robust estimation of heterogeneous causal effects." arXiv preprint arXiv:2004.14497 (2020).
  14. Louizos, Christos, et al. "Causal effect inference with deep latent-variable models." arXiv preprint arXiv:1705.08821 (2017).
  15. Shi, Claudia, David M. Blei, and Victor Veitch. "Adapting neural networks for the estimation of treatment effects." 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), 2019.
  16. Zhao, Zhenyu, Yumin Zhang, Totte Harinen, and Mike Yung. "Feature Selection Methods for Uplift Modeling." arXiv preprint arXiv:2005.03447 (2020).
  17. Zhao, Zhenyu, and Totte Harinen. "Uplift modeling for multiple treatments with cost optimization." In 2019 IEEE International Conference on Data Science and Advanced Analytics (DSAA), pp. 422-431. IEEE, 2019.

Related projects

  • uplift: uplift models in R
  • grf: generalized random forests that include heterogeneous treatment effect estimation in R
  • rlearner: A R package that implements R-Learner
  • DoWhy: Causal inference in Python based on Judea Pearl's do-calculus
  • EconML: A Python package that implements heterogeneous treatment effect estimators from econometrics and machine learning methods

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

causalml-0.15.4.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

causalml-0.15.4-cp312-cp312-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.12Windows x86-64

causalml-0.15.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

causalml-0.15.4-cp312-cp312-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

causalml-0.15.4-cp312-cp312-macosx_10_13_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

causalml-0.15.4-cp311-cp311-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.11Windows x86-64

causalml-0.15.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

causalml-0.15.4-cp311-cp311-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

causalml-0.15.4-cp311-cp311-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

causalml-0.15.4-cp310-cp310-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.10Windows x86-64

causalml-0.15.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

causalml-0.15.4-cp310-cp310-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

causalml-0.15.4-cp310-cp310-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

causalml-0.15.4-cp39-cp39-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.9Windows x86-64

causalml-0.15.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

causalml-0.15.4-cp39-cp39-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

causalml-0.15.4-cp39-cp39-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file causalml-0.15.4.tar.gz.

File metadata

  • Download URL: causalml-0.15.4.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for causalml-0.15.4.tar.gz
Algorithm Hash digest
SHA256 7f5abb2e883911666e8841b915e1f42a7a963f12fc2aeac78a362672acdf0a14
MD5 81982472ba4cbe5303e7831f071ccd9a
BLAKE2b-256 3812ac75b1842c28a9ef5ccdf99b372eefa05ffcbfabf67f1b03a1311c4d9406

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: causalml-0.15.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for causalml-0.15.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f49a70bd4b1aa8f8dd3c1713c1ac72c3d1def2d08bc37733e63f471da0fa3be9
MD5 e4103febbc105528567363d4fcae01f1
BLAKE2b-256 7fecfaa080db2340b5abd4ecdedb60703dcad16c3610018d443e38e7a2d18c2c

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 59179ec56e39524aafec717278854c232c4a962dac2fd2e102070ed71436a598
MD5 d70c24dcdc79aa75786e95eae0348690
BLAKE2b-256 33f983bcbbddd54576db5ea812d101757b2518266091a83e0dcfeec37b34dbbe

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 233c09a5402c6dddfa9c79b60e8628ea1c08640fedb27cc5b9cbdc469004a8c9
MD5 d485272ffe369f5c371161b6415aed4e
BLAKE2b-256 de26e9a3799f924a4d705770f03f27db344d809299eecf54d3db256a70899117

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 7b6b7a6291b915c11a600285eb47e0f9144120c22094716c9ad8a04a6133a086
MD5 be5639f632ee48e0f860550ee3cdfe98
BLAKE2b-256 f6b953243a6b9069502f71c1e1f714d8558ef5fab2575a78e6c78f9fcec170e4

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: causalml-0.15.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for causalml-0.15.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 082f5618b020a293cc315d172cc1cb994bbd4c1404966f9f618e7d2ab8d336ad
MD5 450ea9cf9ceaf26c13151632d6bf4b59
BLAKE2b-256 57e8b7da0b246019075577665bba9e0b18a4bfc2694e3d57d020439e06a8f31c

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e6d1016547ca21056d5cd6fdaf3ac5dce5552d738b8bb99b2328e574c61e1d1
MD5 13088a1a77398bbf2f8d41ce73aae1cb
BLAKE2b-256 b6886fc5e655a29fe9dfd8c3aae4e4ae1c2663f7c168f1508f29580dfaceb948

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adb9d452186a8227ae80f0dc7682ed1ef73525926a8c276c170a296ecc79086b
MD5 d86af2facb073a8f6fc744893cdf1cde
BLAKE2b-256 30d521c6f2fe130cb3a8ee2c4b423c3f7ee0d3413bb9636fa1c9d5f0aa21d170

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8afd31d20555db680cf71e4ccf9bd4db6a3438e7fa833a0cc0382182f51ff4fc
MD5 c692bd6f69132337a767b065813c6ec3
BLAKE2b-256 ccf4e9293ca60ddbed2cea8f026f5b28ecda2421abbf576a352fa21244105cda

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: causalml-0.15.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for causalml-0.15.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f4182791edeb4eae79f00998319c785d2719abcbbc305ec137983c25ccc8132d
MD5 8c7a7f3fb20e477217f7944578930d9c
BLAKE2b-256 405bea3a5bdf0a755b26a6662cf4230a02053d75ccb20a42e3c2fbb001e6dfd9

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 afc82cd54fd787c1aac74037aeea892e0bfb31cad6e8cd2225595eda2b87d5de
MD5 010bf622b494bae5a66229115371ea84
BLAKE2b-256 59667f57e8c63a8ae4e6ab6dd40aaec94744201a7b70eb004c49c9657657e83a

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91599d0f57d174621f4cfad843da61d2e34c00cb42f876cd3678d52d7ce83538
MD5 660be68327493c3ade032bcdc61c12af
BLAKE2b-256 4e1137959b30a01a933a9972f31fc5c5126b670cf8cf120caf2d9de4bd7a4bdc

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f6a227816ed5076e41e1f65d34928d574d395532d6f0ecb178b2b81fd08f50ef
MD5 9aa13c6451e64c25ee61c2d40c36529b
BLAKE2b-256 01d11d834e5c4df579efade805575e302909ff9d10cab300aeef090c35319d89

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: causalml-0.15.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for causalml-0.15.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c75966cb6f387ec1734c5c7ba24273ef4f551c6fe2c73d4444039f2c8658b06e
MD5 bd64adb72b6d8f0636b4d44fb41323dd
BLAKE2b-256 78b9ce0f61b53fd4e1d85e5c59610e4986e645577b84891041c5b4f813a79755

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 29c62771d5530cb7041812d4462f19e6ff678e1bfdeec4c07254f07a0a182897
MD5 f6f7c45e255b544aedf494dd70511054
BLAKE2b-256 a0c6c4ef6f2961647d573aed353536201eebcd0d24d12f801a89942ab5cf2cc4

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3359e13a1c9740b88747915321560613dd01f4383245a314b7647fec4e4b4850
MD5 d24b9397512fb9bb3ae580955e7982b2
BLAKE2b-256 4004fedddd855d3e6d9d0754ee321391e30862a249adec9d1cf29d3042b162b4

See more details on using hashes here.

File details

Details for the file causalml-0.15.4-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9315e8d03d81bcf05ef8987620c3eebc6165f756b95e24fb6f2ce4eac5ae4556
MD5 28916846daa673a64a7390cc8a2b4324
BLAKE2b-256 e353a49e61bc1849836f8a07b99e79b503f4b6beb83411b1c92524873b2994ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page