Skip to main content

Double Machine Learning in Python

Project description

DoubleML - Double Machine Learning in Python

build PyPI version Conda Version codecov Codacy Badge Python version

The Python package DoubleML provides an implementation of the double / debiased machine learning framework of Chernozhukov et al. (2018). It is built on top of scikit-learn (Pedregosa et al., 2011).

Note that the Python package was developed together with an R twin based on mlr3. The R package is also available on GitHub and CRAN Version.

Documentation and Maintenance

Documentation and website: https://docs.doubleml.org/

DoubleML is currently maintained by @PhilippBach and @SvenKlaassen.

Bugs can be reported to the issue tracker at https://github.com/DoubleML/doubleml-for-py/issues.

Main Features

Double / debiased machine learning (Chernozhukov et al. (2018)) for

  • Partially linear regression models (PLR)
  • Partially linear IV regression models (PLIV)
  • Interactive regression models (IRM)
  • Interactive IV regression models (IIVM)

The object-oriented implementation of DoubleML is very flexible. The model classes DoubleMLPLR, DoubleMLPLIV, DoubleMLIRM and DoubleIIVM implement the estimation of the nuisance functions via machine learning methods and the computation of the Neyman orthogonal score function. All other functionalities are implemented in the abstract base class DoubleML. In particular functionalities to estimate double machine learning models and to perform statistical inference via the methods fit, bootstrap, confint, p_adjust and tune. This object-oriented implementation allows a high flexibility for the model specification in terms of ...

  • ... the machine learners for the nuisance functions,
  • ... the resampling schemes,
  • ... the double machine learning algorithm,
  • ... the Neyman orthogonal score functions,
  • ...

It further can be readily extended with regards to

  • ... new model classes that come with Neyman orthogonal score functions being linear in the target parameter,
  • ... alternative score functions via callables,
  • ... alternative resampling schemes,
  • ...

An overview of the OOP structure of the DoubleML package is given in the graphic available at https://github.com/DoubleML/doubleml-for-py/blob/main/doc/oop.svg

Installation

DoubleML requires

  • Python
  • sklearn
  • numpy
  • scipy
  • pandas
  • statsmodels
  • joblib

To install DoubleML with pip use

pip install -U DoubleML

DoubleML can be installed from source via

git clone git@github.com:DoubleML/doubleml-for-py.git
cd doubleml-for-py
pip install --editable .

Detailed installation instructions can be found in the documentation.

Contributing

DoubleML is a community effort. Everyone is welcome to contribute. To get started for your first contribution we recommend reading our contributing guidelines and our code of conduct.

Citation

If you use the DoubleML package a citation is highly appreciated:

You can click the "Cite this repository" button at the top of the GitHub page to cite the package directly. Alternatively, you can cite the following paper:

Bach, P., Chernozhukov, V., Kurz, M. S., and Spindler, M. (2022), DoubleML - An Object-Oriented Implementation of Double Machine Learning in Python, Journal of Machine Learning Research, 23(53): 1-6, https://www.jmlr.org/papers/v23/21-0862.html.

Bibtex-entry:

@article{DoubleML2022,
      title   = {{DoubleML} -- {A}n Object-Oriented Implementation of Double Machine Learning in {P}ython},
      author  = {Philipp Bach and Victor Chernozhukov and Malte S. Kurz and Martin Spindler},
      journal = {Journal of Machine Learning Research},
      year    = {2022},
      volume  = {23},
      number  = {53},
      pages   = {1--6},
      url     = {http://jmlr.org/papers/v23/21-0862.html}
}

Acknowledgements

Funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) is acknowledged – Project Number 431701914 and Grant GRK 2805/1.

References

Bach, P., Chernozhukov, V., Kurz, M. S., and Spindler, M. (2022), DoubleML - An Object-Oriented Implementation of Double Machine Learning in Python, Journal of Machine Learning Research, 23(53): 1-6, https://www.jmlr.org/papers/v23/21-0862.html.

Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., Hansen, C., Newey, W. and Robins, J. (2018), Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal, 21: C1-C68. doi:10.1111/ectj.12097.

Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M. and Duchesnay, E. (2011), Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research, 12: 2825--2830, https://jmlr.csail.mit.edu/papers/v12/pedregosa11a.html.

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

doubleml-0.11.2.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

doubleml-0.11.2-py3-none-any.whl (603.5 kB view details)

Uploaded Python 3

File details

Details for the file doubleml-0.11.2.tar.gz.

File metadata

  • Download URL: doubleml-0.11.2.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for doubleml-0.11.2.tar.gz
Algorithm Hash digest
SHA256 90092284f7b6193f15d8dbc6340d49c6efee6da9b753729d4461c5cb91104a78
MD5 280190dcbe7a8b42f3bb0601856443c3
BLAKE2b-256 12fabd4873db92accc57951b6a9efbac435895905107453b1beb89018fd4a809

See more details on using hashes here.

Provenance

The following attestation bundles were made for doubleml-0.11.2.tar.gz:

Publisher: deploy_pkg.yml on DoubleML/doubleml-for-py

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

File details

Details for the file doubleml-0.11.2-py3-none-any.whl.

File metadata

  • Download URL: doubleml-0.11.2-py3-none-any.whl
  • Upload date:
  • Size: 603.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for doubleml-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74fc8f06546863319ab4c856a54c112a52c7d384430f3d24a8ecdcbe8280b5c5
MD5 76bf1e7832d3f4f9e439fde8f7e5b821
BLAKE2b-256 c290a399dc3db1b7e4fec9ce14de4e1878bf410163150a5e06a463f8c277c92f

See more details on using hashes here.

Provenance

The following attestation bundles were made for doubleml-0.11.2-py3-none-any.whl:

Publisher: deploy_pkg.yml on DoubleML/doubleml-for-py

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