Skip to main content

dml-rs

PyPI Python versions CI License

Fast double / debiased machine learning for causal inference, implemented in Rust.

dml-rs implements the double / debiased machine learning framework of Chernozhukov et al. (2018) with a scikit-learn style API. Every model is tested for numerical agreement with the reference DoubleML package, and the Rust core makes estimation typically 3–24× faster.

Installation

pip install dml-rs

Prebuilt wheels are available for Linux, macOS and Windows (Python 3.9 or newer).

Quick start

import numpy as np
import dml_rs

# Simulated data: the true effect of d on y is 0.5; X confounds both
rng = np.random.default_rng(42)
n = 2000
X = rng.normal(size=(n, 5))
d = np.sin(X[:, 0]) + X[:, 1] ** 2 + rng.normal(size=n)
y = 0.5 * d + np.cos(X[:, 0]) + X[:, 1] ** 2 + rng.normal(size=n)

model = dml_rs.PLR(
    ml_l=dml_rs.RandomForestRegressor(min_samples_leaf=5),  # learner for E[y | X]
    ml_m=dml_rs.RandomForestRegressor(min_samples_leaf=5),  # learner for E[d | X]
    n_folds=5,
)
model.fit(X, y, d)
print(model.summary)
       coef   std err          t         P>|t|     2.5 %    97.5 %
d  0.516919  0.029474  17.538215  7.319031e-69  0.459151  0.574687

Any scikit-learn estimator works as a learner. The built-in learners (GradientBoostingRegressor, RandomForestRegressor, Lasso, LassoCV, Ols, LogisticRegression, LogisticRegressionCV, and the corresponding classifiers) run the whole estimation in Rust, in parallel and without the GIL, and are scikit-learn estimators themselves (GridSearchCV, Pipeline, clone and tuning work with them).

Models

Class Target parameter
PLR Partially linear regression: effect of a continuous or binary treatment
IRM Interactive regression model: ATE / ATTE of a binary treatment; cate and gate
PLIV Partially linear IV regression
IIVM Interactive IV model: LATE with a binary instrument
DID, DIDCS Difference-in-differences for panels and repeated cross-sections
StaggeredDID Staggered adoption: ATT(g, t) with group, time and event-study aggregation
SLearner, TLearner, XLearner, RLearner, DRLearner Heterogeneous (conditional average) treatment effects

All estimators support repeated sample splitting, multiplier bootstrap with simultaneous confidence bands (bootstrap, confint(joint=True)), multiple-testing adjustment (p_adjust), pandas summaries, and the scikit-learn parameter protocol (get_params, set_params, clone). PLR, IRM and DID models also offer sensitivity analysis for omitted confounders (sensitivity_analysis, sensitivity_summary, sensitivity_benchmark). Pass cluster= to fit for cluster-robust inference with one- or two-way clustered data, and inspect the nuisance learners with nuisance_loss_ and evaluate_learners.

Documentation

Full feature overview, benchmarks and validation details: https://github.com/AsadGudzevic94/dml-rs

License

Licensed under either of the Apache License 2.0 or the MIT license, at your option.

Metadata

Release files for dml-rs 0.27.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dml-rs 0.27.0
File Size Uploaded Provenance Actions
dml_rs-0.27.0.tar.gz 419.0 kB With provenance Details for dml_rs-0.27.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dml-rs 0.27.0
File Actions
dml_rs-0.27.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for dml_rs-0.27.0-cp39-abi3-win_amd64.whl
dml_rs-0.27.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for dml_rs-0.27.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
dml_rs-0.27.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for dml_rs-0.27.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
dml_rs-0.27.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for dml_rs-0.27.0-cp39-abi3-macosx_11_0_arm64.whl
dml_rs-0.27.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for dml_rs-0.27.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 10.4 MB

Release files / dml_rs-0.27.0.tar.gz

Download URL dml_rs-0.27.0.tar.gz
Size 419.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c6c90a62f4043ffb22a453b6f5953058f506ee52885324c44ee7b1e61df9dd7e
BLAKE2b-256 checksum
How to use checksums
494f404919b5d0bae6d3c14721e7617873b7c03d2e091cd7bf3eba8782012094
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / dml_rs-0.27.0-cp39-abi3-win_amd64.whl

Download URL dml_rs-0.27.0-cp39-abi3-win_amd64.whl
Size 1.9 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8475d726abfd208051353c56308c118976e51e2a2dae44031d4f73060dd1ac2c
BLAKE2b-256 checksum
How to use checksums
22e3406460439965d821f252c9ccf3fed3a45559df935720836e59fc9cb6f8e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / dml_rs-0.27.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL dml_rs-0.27.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
fb2b7d146bb80640c21895f7548b5151d50cf887b5a6ba8ab4ba5cdd8d3ddb89
BLAKE2b-256 checksum
How to use checksums
7231eae8f3ce12f4bedf34163b6e599168494afbf35502f5bd5553aad05c32c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / dml_rs-0.27.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL dml_rs-0.27.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.1 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
491e6c192b167f437509dbf5317c17cd4de42abdd7fa92362f6aae1e628808c4
BLAKE2b-256 checksum
How to use checksums
5740fdcb7c985ea7f6874d784eb7475b89a187f0a34d855718928a324737451a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / dml_rs-0.27.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL dml_rs-0.27.0-cp39-abi3-macosx_11_0_arm64.whl
Size 1.9 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1a26f532da96f247fd998ae27c4bd89b88b6a7ea1c62c1db255a44f019f6aafd
BLAKE2b-256 checksum
How to use checksums
1d318b943e61c657fcc9a0fc2e3e942c600badc59f54b6aea480742dc4acbed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / dml_rs-0.27.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL dml_rs-0.27.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 2.0 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b31f1e16630210039bb25c31e03df8ca7913c66d9732278fe63d79acbd218874
BLAKE2b-256 checksum
How to use checksums
b97f7cf0cd92793678698580ff787af26a0e6805047f40aff3911ab56dd4b7af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for dml-rs 0.27.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for dml_rs-0.27.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.27.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page