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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.12Windows x86-64

causalml-0.15.5-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.5-cp312-cp312-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.13+ x86-64

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

Uploaded CPython 3.11Windows x86-64

causalml-0.15.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.9+ x86-64

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

Uploaded CPython 3.10Windows x86-64

causalml-0.15.5-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.5-cp310-cp310-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

causalml-0.15.5-cp39-cp39-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.9Windows x86-64

causalml-0.15.5-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.5-cp39-cp39-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

causalml-0.15.5-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.5.tar.gz.

File metadata

  • Download URL: causalml-0.15.5.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.5.tar.gz
Algorithm Hash digest
SHA256 83aabcd8a7a67013ae45f4e31cb277a9ed2f1bd5a7b024ee7dd23fc2d8573f5b
MD5 b83cab63b5af1399d4716674023d6f7b
BLAKE2b-256 da9afec847688432391a605a9bc63a26b9067dc5cdce9607f3df7a64eecbc111

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causalml-0.15.5-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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1c2b612a71f732d186bea95b305608d209f34fbf78bcdcc4fa6b2dae69f85c88
MD5 ec8f10c71249ba1952a8ab5969f7dc52
BLAKE2b-256 af768655eaae04db02a777bdba8c71783f41726c5021e920c94f192c82abc1a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bf91a3d811c889dab5177ff0ad2b9d4c513b9afa05dff6345d3d113c2b95c12e
MD5 2b794048c057869317572a8bc66ea408
BLAKE2b-256 b316a295898909116ac4072a0a7af77163fc5eb1665e68e042c2ce7aa7bdc1ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a66b7dca2d0386f9704d1824e6d85e39ae066a4a266d44e06df547d7903f605
MD5 0c4517db84b445a3fcfbd65024ee70f8
BLAKE2b-256 575392bffb038320af2618c597e26f46072211240fc4f8b15aa2fab5db4711ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 5dee51d3e8ed580f6675434db8b9e85cde9a6b96c46adbc093adb3e3e55a1c1c
MD5 0ae24a437fd81b3326723ba664ed9372
BLAKE2b-256 fb2fe569228ca47ad81f85d1ed9a00ead11fa19ef21fc06b047a7afdfc694cf5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causalml-0.15.5-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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 936bff68c1bf359ae2c480c6d41fb6976eee2c824a577aa25f262969c23c96e2
MD5 64a0335a34d131ccbbba07a239ccbc4a
BLAKE2b-256 be610159d421f3bd14b166bccdc40591b5ad4845f118b518d2926d3262d770c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4c94bae797ec07a69b6ddac14c8205e3704763929f68025057d3388ff0334a1
MD5 20bee3d6bdc69b8b06ab14fefc39afc6
BLAKE2b-256 c9d872f6d595592bab4f2f790103e4750fadbc711f489cbd28c62ba2af0d24be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42bfacab0f6aa7bfd7c45707cfa153dd97f626342592e7dd458ff56defdf3eaa
MD5 7642bc5632536a736142e0ee6356f2b8
BLAKE2b-256 187e578c478c7797243f2bc65c7fab562f884b699ebc87fb5849951985dc7b3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ffb9a8aa8e1e448df8d5a3838a6a9a0be3bf05de794127e05aaaf380345cc178
MD5 c7f88dae2843da829b78205d70863a1f
BLAKE2b-256 525080b92b1e3d791dd974524a200ad22c659302424788382d8a41e9f9d36d62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causalml-0.15.5-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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a68fa4bf29a7776de25b5e8ef18c781011eb48452b1e150b89aec40a2c1ec8fe
MD5 f4fc189205c0e3227c4c2d7e9883ccb5
BLAKE2b-256 e22d767916368d639535889f3be9e5bc236ff641d9218ee9507a554bf47a2299

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a190e5aee63f3aeb4de887326afcdb0874dc91b877bd17e8a08ceaf56b07e26b
MD5 ebba5e81348148efa01d0b86f2bf2463
BLAKE2b-256 4829c66b2bbc0e272ad087ef2a495fba82648166dd83921a13eae123aafa8a37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58951b4d95cdb2894b365fc6a380a2890128af4f43b84e0ee1f30c0e5351fab5
MD5 66d3598dc424b5a08758ebae8ff777e6
BLAKE2b-256 51db04d1ba44287721273936e7ab67ca5b2f6f2cc2a245bb69844c8dfa6433ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2b967cef549e4b9fc41f6a9461795ef043318f9c82efef10d6a76c37560d6cc5
MD5 b427cbbb76071b44930644a15e30bb23
BLAKE2b-256 4e78c37ae95f66d1b3ceadbcf1468fed847a64ee65ceb22cc65429efca22e1e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causalml-0.15.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.9 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.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 427cf6bca0620fd0601ed0fb63b41f056e6ac8a5353f82ee9fc4246f91c16721
MD5 22688609db0e93464e75029d9f89bb0f
BLAKE2b-256 145aeee3682123dea7e8519f6b81b780e9540f2ffa82945779397caf2de6e5ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57ac01abdaaef5d8d2142e6d258f32b5fe8d111a2f0359805630ace1439d4dee
MD5 f6f91e931e6fa09167b4e174a57bc0ce
BLAKE2b-256 a3a989dd89a997a3960c2798556f197c6bc94feb0a1212ade43813d9986ec789

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16a76d90c707833c40d363e445020c30cbc7a5eee8e8802c234444f143060f67
MD5 897e21dedf15e3cd0a8e95bb94d2a97f
BLAKE2b-256 39613429cb9f7215e51d4de102ca279ff5605cec22bfddfdae60cc837dfdb564

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1efe35eade6fea1f4400ca4dd39f92cd1fc5717ec8c7549ea7244a752d138a35
MD5 ef7672568f1f65000a485cff4938012c
BLAKE2b-256 239d082f1be00027053414ecbf8f4766a4aa358ffd49f078b39b5a936fbce057

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