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) 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.17.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded CPython 3.12Windows x86-64

causalml-0.17.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

causalml-0.17.0-cp312-cp312-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

causalml-0.17.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for causalml-0.17.0.tar.gz
Algorithm Hash digest
SHA256 638e9a1d5feadf3c441dadb24bfd26451100b95b4edec5f7dab1f6d326152d95
MD5 49cb3577e68a4a5b1b95ce3fa5b3e7f3
BLAKE2b-256 b1267422e3d87d39fc795efd47f56f119a0629c8e2078c16f1b823747b9c9997

See more details on using hashes here.

Provenance

The following attestation bundles were made for causalml-0.17.0.tar.gz:

Publisher: python-publish.yml on uber/causalml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

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

File hashes

Hashes for causalml-0.17.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 88044b6f9f5ea5a38e3d86d96deef81004ce44bd951f259c88f25860080579b6
MD5 a159a8e0074ccc14db8bbdb4c45fe7bb
BLAKE2b-256 797f86cae6376c012f0d4939224218ed5dc4cd8fff511260cc4a9b36b1a155e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for causalml-0.17.0-cp312-cp312-win_amd64.whl:

Publisher: python-publish.yml on uber/causalml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file causalml-0.17.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.17.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 728733e011b34e7696449545d22256d53c8105106b3bbe3a0a7614f941c2e09d
MD5 06f757730e0b9c437f7578f0947fd8f8
BLAKE2b-256 9c9ecd27a07edf451d0533a7ffc94d138e41409efd0cdf110f4d0965e24361df

See more details on using hashes here.

Provenance

The following attestation bundles were made for causalml-0.17.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on uber/causalml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for causalml-0.17.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a1c82b656553909a8b127785cbad0ab779dec31abb53d37420da8f44e6cce90a
MD5 4ac429cedb5da769891d1a852d50d2d1
BLAKE2b-256 0e9850977aaf78f60201c852450de82ca3172b8e3816306a729b20bfffc9ac47

See more details on using hashes here.

Provenance

The following attestation bundles were made for causalml-0.17.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on uber/causalml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

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

File hashes

Hashes for causalml-0.17.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 581f047305405eaf627697b288d4725d4120d24fe06f8f8a781ddb6a00a91124
MD5 6a5d64af425499326b63a93366d30ed4
BLAKE2b-256 0670206284d5d57cd7507797f8a65b4bdfe724261995aa91b6d7440a8e4461f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for causalml-0.17.0-cp311-cp311-win_amd64.whl:

Publisher: python-publish.yml on uber/causalml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file causalml-0.17.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.17.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 201997bfaf84a5719ce9003f641de3d04f8debb6c47e246e63adcbfb8f0aaa44
MD5 93b8bcb537e65076e6c62c008aa6ad53
BLAKE2b-256 481f4b0549110de67f3478fbd818102b95cc8193e7daec4fb70050832361fd6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for causalml-0.17.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on uber/causalml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for causalml-0.17.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d5f2b30a48b5dc273495cc91354e0184cd270dcdca249c54178c186d14dd784e
MD5 584cb0808456f02a2423d1f04e6ae0e7
BLAKE2b-256 b55ea9e7cf356c10ce8d609151d6ac6f583f29000e6114475ef966d02d7a1e77

See more details on using hashes here.

Provenance

The following attestation bundles were made for causalml-0.17.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on uber/causalml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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