Registry / ai-ml / doubleml

doubleml

JSON →
library0.11.2pypypi✓ verified 85d ago

DoubleML provides an implementation of double/debiased machine learning for causal inference. Current version is 0.11.2, requiring Python >=3.10. Release cadence is irregular, with several minor releases per year.

pip install doubleml
INSTALL
IMPORT
SIG · DOUBLEML
D
doubleml
ai-mlpythonv0.11.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DoubleMLData
from doubleml import DoubleMLData
from doubleml.data import DoubleMLData
DoubleMLData was moved to the main package in v0.10.0; the old import path no longer works.

Basic causal effect estimation using DoubleML with Lasso and logistic regression learners.

import doubleml as dml from sklearn.linear_model import LassoCV, LogisticRegressionCV import numpy as np # Generate synthetic data np.random.seed(42) n = 500 X = np.random.normal(0, 1, (n, 20)) d = np.random.binomial(1, 1/(1+np.exp(-X[:, 0])), size=n) y = d * 0.5 + X[:, 0] + np.random.normal(0, 1, n) # Create DoubleML data object dml_data = dml.DoubleMLData.from_arrays( y=y, d=d, x=X ) # Initialize model (Partially Linear Regression Model) model = dml.DoubleMLPLR( obj_dml_data=dml_data, ml_g=LassoCV(), ml_m=LogisticRegressionCV() ) # Fit and summarize model.fit() print(model.summary)
Debug
Known issues
breakingDoubleMLData import path changed in v0.10.0. Previously `from doubleml.data import DoubleMLData`, now `from doubleml import DoubleMLData`. Old code will raise ImportError.
fix
Use `from doubleml import DoubleMLData`. For panel data, use `from doubleml import DoubleMLPanelData`.
affects: <0.10.0
deprecatedThe `rmses` property for classifiers is deprecated since v0.8.2. Use `nuisance_loss` instead.
fix
Replace `model.rmses` with `model.nuisance_loss`.
affects: >=0.8.2
gotchaHyperparameter tuning with Optuna requires the 'optuna' extra. Install with `pip install doubleml[optuna]`.
fix
Install the optional dependency: `pip install doubleml[optuna]`.
affects: >=0.11.1
gotchaDoubleMLData constructor expects numpy arrays or pandas DataFrame/Series. Passing raw lists may cause errors.
fix
Convert lists to numpy arrays or pandas objects before passing to DoubleMLData.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'DoubleMLData' from 'doubleml.data'
DoubleMLData was moved to the top-level `doubleml` package in v0.10.0.
fix
Change import to `from doubleml import DoubleMLData`.
ImportError: cannot import name 'DoubleMLPLR' from 'doubleml'
The class name might be misspelled or older version used a different name (e.g., DoubleMLPLR is correct, but DoubleMLLPLR exists since v0.11.0).
fix
Ensure correct spelling: `from doubleml import DoubleMLPLR` for partially linear regression model.
AttributeError: 'DoubleMLPLR' object has no attribute 'rmses'
The `rmses` property was renamed to `nuisance_loss` in v0.8.2.
fix
Use `model.nuisance_loss` instead of `model.rmses`.
ValueError: The nuisance model for the treatment 'ml_m' could not be fitted because it is a classifier and the treatment variable has more than two categories.
LogisticRegressionCV only works for binary treatment. For multi-category treatment, use a different classifier or treat treatment as continuous.
fix
Ensure treatment variable is binary, or use a multi-class classifier like `RandomForestClassifier`.
Upgrade
Version history
0.11.2latest on PyPI · released Jan 19, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
doubleml — pip install doubleml · libregistry