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)
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.
fixChange 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).
fixEnsure 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.
fixUse `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.
fixEnsure 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.