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, Ols, LogisticRegression, and the corresponding classifiers) run the whole estimation in Rust, in parallel and without the GIL.

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).

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.6.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.6.0
File Size Uploaded Provenance
dml_rs-0.6.0.tar.gz 108.6 kB With provenance Details

Built distributions (wheels)

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

Total release size: 3.7 MB

Release files / dml_rs-0.6.0.tar.gz

Download URL dml_rs-0.6.0.tar.gz
Size 108.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5a99777ceb192e1b3aa97cfc0664ba21f39cdad7d15d23bf1f075dc05b299904
BLAKE2b-256 checksum
How to use checksums
bd16191284d2ee66ae01a2897aa4c1f095bc8ac18535ac901c3bc2b125b3ba36
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 23, 2026.

Transparency log

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

Download URL dml_rs-0.6.0-cp39-abi3-win_amd64.whl
Size 607.6 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7585ea3bd201618c050bc8d994f0ba40a73bc6388145e7f9f788ea77157f6c6c
BLAKE2b-256 checksum
How to use checksums
faf19a07b799f3b06c8ff7d3a618a24722515ada40e70327b75093def96c122c
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 23, 2026.

Transparency log

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

Download URL dml_rs-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 791.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
84989dcd1b0ec3a273a4f2ab49be590ca49b13157e06382b66bcf8549ca374b1
BLAKE2b-256 checksum
How to use checksums
2a2addb322f80dbaa13a41b867f992b5b45a3b19c9731905b7bee55f502e22ac
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 23, 2026.

Transparency log

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

Download URL dml_rs-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 751.3 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
31c0880db233b9475a71c3d25be25c73c33e04fcbf030d7f7dd1e77f1decb021
BLAKE2b-256 checksum
How to use checksums
849c64f52d9debff03b9386d8579d57ed9845b494d90fbf60ee435c21dea1c32
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 23, 2026.

Transparency log

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

Download URL dml_rs-0.6.0-cp39-abi3-macosx_11_0_arm64.whl
Size 686.8 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9e7c9a653a823b155df5d9a7ccec7a119ee0b5c4b6d0b64f9e05bfdbe2229f84
BLAKE2b-256 checksum
How to use checksums
640a1ce90e6122d3aac44c60c7eac4805dfd7216eff2a4785d26679439e3f19a
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 23, 2026.

Transparency log

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

Download URL dml_rs-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 730.2 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3766a92798e07301b4fcc671411e71166795775c9132bd4e9cb2052991ddfce4
BLAKE2b-256 checksum
How to use checksums
a9c5a25c562e880b39127d719c34b229c2be7e499456474333ad80d414f1e0a7
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 23, 2026.

Transparency log

Security for dml-rs 0.6.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.6.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 23, 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.

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