Skip to main content

Modified Causal Forest in Python

Project description

PyPI Downloads PyPI Downloads

mcf – Modified Causal Forest in Python

mcf is a Python package implementing the Modified Causal Forest (MCF) methodology introduced by Lechner (2018) for estimating heterogeneous causal effects.

It provides a flexible framework for causal machine learning with support for binary and multiple treatments in both experimental and observational data settings.

In addition to treatment effect estimation, mcf enables data-driven policy learning through optimal treatment allocation rules based on estimated potential outcomes.


Documentation and Maintenance


Main Features

The mcf package provides two core components for causal machine learning:

Modified Causal Forest

The ModifiedCausalForest class implements a flexible tree-based framework for estimating heterogeneous treatment effects. It supports:

  • Estimation of and inference for individualized treatment effects (IATEs) and aggregates as the (group) average treatment effects (GATEs, ATEs)
  • Binary and multiple treatment settings
  • Experimental and observational data
  • Flexible covariate specification (ordered and unordered variables)

The object-oriented design provides a unified workflow for model training, prediction, and extraction of causal estimates.


Optimal Policy Learning

The OptimalPolicy class enables data-driven treatment assignment by learning decision rules that maximize a reward function. It provides:

  • Learning of optimal treatment allocation rules
  • Policy evaluation on training and test data
  • Support for multiple treatment alternatives and policy constraints

This allows translation of policy scores into actionable decision rules for optimal policy design.


Citation

The implementation builds on the following literature:

  • Lechner (2019): Modified Causal Forests for Estimating Heterogeneous Causal Effects. arXiv:1812.09487.
@misc{lechner2019modifiedcausalforest,
  title        = {Modified Causal Forests for Estimating Heterogeneous Causal Effects},
  author       = {Michael Lechner},
  year         = {2019},
  eprint       = {1812.09487},
  archivePrefix = {arXiv},
  primaryClass = {econ.EM},
  url          = {https://arxiv.org/abs/1812.09487}
}

License

This project is distributed under the MIT License.

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

mcf-0.10.0.tar.gz (466.4 kB view details)

Uploaded Source

File details

Details for the file mcf-0.10.0.tar.gz.

File metadata

  • Download URL: mcf-0.10.0.tar.gz
  • Upload date:
  • Size: 466.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcf-0.10.0.tar.gz
Algorithm Hash digest
SHA256 2de3c14e75d6fecedd9d3133fb1ac3b984fb83430054356f94a0a6e7bce5cf1a
MD5 bb282f98492489b37d3c9f00d0695f56
BLAKE2b-256 ce039c83b4630479b9dfa76a50f47015a2998abeefe088834b7724e102b4a7bb

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