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

Conference Talks and Publications by CausalML Team

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.1.tar.gz (1.5 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.15.1-cp311-cp311-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.11Windows x86-64

causalml-0.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

causalml-0.15.1-cp311-cp311-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

causalml-0.15.1-cp311-cp311-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

causalml-0.15.1-cp310-cp310-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.10Windows x86-64

causalml-0.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

causalml-0.15.1-cp310-cp310-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

causalml-0.15.1-cp310-cp310-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

causalml-0.15.1-cp39-cp39-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.9Windows x86-64

causalml-0.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

causalml-0.15.1-cp39-cp39-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

causalml-0.15.1-cp39-cp39-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

causalml-0.15.1-cp38-cp38-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.8Windows x86-64

causalml-0.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

causalml-0.15.1-cp38-cp38-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

causalml-0.15.1-cp38-cp38-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: causalml-0.15.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.18

File hashes

Hashes for causalml-0.15.1.tar.gz
Algorithm Hash digest
SHA256 99f3cf70cdeb19c6a043c24fe555fc8d1e60d8df8f4567ee6aaf56bc85fc2165
MD5 57e788f05154c4e32e12f2823cdb4c3a
BLAKE2b-256 a648cdaef838b468554c708fce203f3eb878012cbbe06eb355eb574f2b36cbd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causalml-0.15.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.13

File hashes

Hashes for causalml-0.15.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 725b3d3f5982e9f24980a7f94cd2fd04d62cc6cafa698127f7f6ca97adeff134
MD5 d5f0e70399991ebf66f7004c45b6b26a
BLAKE2b-256 0b187ec7a343e216786ac6e71e567bb2ec2640e23e85bfb6ca385009058ee680

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1742485a79b72fcc2486e988a3c866eeaf4f9e05a29e064a23900c884a50fa8e
MD5 cea07daf88ed23a11a2e72b4900ac47c
BLAKE2b-256 090c3099e538887266da750c27f574753d531600d5f7a9d1ffe1eb0066cd47bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89d738a3e8e8689f415034ffb57b9603d868b4c93afe58ba117046ee9d523b0d
MD5 766b124ce14cc4e01411c844f5664d42
BLAKE2b-256 15f24fed1ca7607fdc1862ee143831d5bbad54a5814ed4b43395b1d05c90c36c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d099d8f8f786e4e10bbe993a75949e0638d68ba129742eed5a2f6a263ce41d4a
MD5 41aa900aff94c3c1a183d4a2f0e00aa8
BLAKE2b-256 3b9f3aaa3df338ea44dfd5f70485eebb1259daaeeb78ebdb440c9d218ea8e9eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causalml-0.15.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.13

File hashes

Hashes for causalml-0.15.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bf2991eb91b0dc5fc72e87f4861f5206652dd6b9a91aef783a8464418a78e85a
MD5 9b2abaf4b33ddd0de8f4cf85abbfa838
BLAKE2b-256 fa6fe0ae13f18c6951380849d393b02aa95e8c63564127aa35de3f8090ceb428

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b78a95a5619207f6c453a7efa80e2275f6d173fb730244e3439d98e6a2a26062
MD5 bd6d07d0d15d695b819bd65de915e74d
BLAKE2b-256 96a0166e12f7665fd6bcc5ab2f8bd89e1b081edecad95617e1391b4395ce0665

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b3a5c6e94da056da20e42adc9ed97d6c10210ced30037a9c3bfaf8317bc94e3
MD5 22fd27e104765f89769ac1d402085b82
BLAKE2b-256 022e3c8c7426361210b5de5536ccd32daa0a66bc0c99430ad457df9b4c95fbfd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 19e8d4ffd4adc8dced2c8d4544020fd2d56b29ef960c374e1c9ec7704b317ae9
MD5 13bbe7e2a2c9c9288b61af25547b2b47
BLAKE2b-256 4390b0ca4b0d780e4ead576c65955a1e50c9d9e9ca8256013c3b6bdd64609344

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causalml-0.15.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.13

File hashes

Hashes for causalml-0.15.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 51b315703fdb52203cabd51516e2069472db75fe084407c6860f7f1f20a73c97
MD5 765667192c0561629814b218e3b8aceb
BLAKE2b-256 5a1c9e8b7a690672c0c2747287273e0ae7c7c3390fa65c1c638926245d8b419f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb4545384c73f761738e55db782a9926583baf53d12fcbb58c76f2898595018e
MD5 a5b23e381ebb07357473310899212dfd
BLAKE2b-256 8d56bfc032dea7e271704589d2621b917602a9490f0eaceb53117715e3737935

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e31db4932a948dec20a411ccbbd9a63e0d6af434eda3b79fce90a794b29506a
MD5 0e4e8d0c868d1ffc1f0b84549b871695
BLAKE2b-256 c5ad3b0970519a5769f9f0f8842eee8e76a95bd4c013ed1cfb53eb99e6f007d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causalml-0.15.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 48d6a16da930f61c600d7adbe25e4649559d07a74bd1dd584fce2f691e391fbf
MD5 74dbadbc46a50021461946f48eb32d85
BLAKE2b-256 7200e6bcc27d66126fc06d9e4cfabc71d736e86e84bc5ee0a987cdfc6c2d97d4

See more details on using hashes here.

File details

Details for the file causalml-0.15.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: causalml-0.15.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.13

File hashes

Hashes for causalml-0.15.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f63360110111b21cf48a9883365e32e8de1758c329b7bcb3e8bba787d4cd8f35
MD5 f535330f6f9223edf593e69c3c945211
BLAKE2b-256 84b2d18d8e983d504b42dea87b3010a1d84eed41830b81e0460588e7bb1a8109

See more details on using hashes here.

File details

Details for the file causalml-0.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ccd3fe47f4836c2039f28c41653b435c949b48bfa773e19a3023a07bfe2310ff
MD5 5d9075e0ee3c962a4a77e9edbd663565
BLAKE2b-256 0f39104899c1f05fbc1818cb593434deb6228e6744be4065c8f759a403771358

See more details on using hashes here.

File details

Details for the file causalml-0.15.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for causalml-0.15.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d48e6c168400e5fcdb775df1c6e4fcc1ea64a42f159cbf195e965f16d94953f2
MD5 bcfaf8dd334e1565b22dbeb96c78c46c
BLAKE2b-256 425d1fdb739baeb4cf07acf68ae011616168cfb12f32ccba47901646409fde96

See more details on using hashes here.

File details

Details for the file causalml-0.15.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for causalml-0.15.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d77a949cd08bd106341c8c6e6fb58af04e01e534e8e11d6294be0ad65593327a
MD5 20444933454a118a94f8973623ca6ab9
BLAKE2b-256 fe8e0aeb0582761216f5916f73f7ff8c1be462690842a4fce344f58e29d39146

See more details on using hashes here.

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