{"id":27706,"library":"doubleml","title":"DoubleML","description":"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.","status":"active","version":"0.11.2","language":"python","source_language":"en","source_url":"https://github.com/DoubleML/doubleml-for-py","tags":["causal-inference","double-machine-learning","econometrics","machine-learning"],"install":[{"cmd":"pip install doubleml","lang":"bash","label":"default install"},{"cmd":"pip install doubleml[optuna]","lang":"bash","label":"with Optuna tuning support"}],"dependencies":[],"imports":[{"note":"DoubleMLData was moved to the main package in v0.10.0; the old import path no longer works.","wrong":"from doubleml.data import DoubleMLData","symbol":"DoubleMLData","correct":"from doubleml import DoubleMLData"}],"quickstart":{"code":"import doubleml as dml\nfrom sklearn.linear_model import LassoCV, LogisticRegressionCV\nimport numpy as np\n\n# Generate synthetic data\nnp.random.seed(42)\nn = 500\nX = np.random.normal(0, 1, (n, 20))\nd = np.random.binomial(1, 1/(1+np.exp(-X[:, 0])), size=n)\ny = d * 0.5 + X[:, 0] + np.random.normal(0, 1, n)\n\n# Create DoubleML data object\ndml_data = dml.DoubleMLData.from_arrays(\n    y=y, d=d, x=X\n)\n\n# Initialize model (Partially Linear Regression Model)\nmodel = dml.DoubleMLPLR(\n    obj_dml_data=dml_data,\n    ml_g=LassoCV(),\n    ml_m=LogisticRegressionCV()\n)\n\n# Fit and summarize\nmodel.fit()\nprint(model.summary)","lang":"python","description":"Basic causal effect estimation using DoubleML with Lasso and logistic regression learners."},"warnings":[{"fix":"Use `from doubleml import DoubleMLData`. For panel data, use `from doubleml import DoubleMLPanelData`.","message":"DoubleMLData import path changed in v0.10.0. Previously `from doubleml.data import DoubleMLData`, now `from doubleml import DoubleMLData`. Old code will raise ImportError.","severity":"breaking","affected_versions":"<0.10.0"},{"fix":"Replace `model.rmses` with `model.nuisance_loss`.","message":"The `rmses` property for classifiers is deprecated since v0.8.2. Use `nuisance_loss` instead.","severity":"deprecated","affected_versions":">=0.8.2"},{"fix":"Install the optional dependency: `pip install doubleml[optuna]`.","message":"Hyperparameter tuning with Optuna requires the 'optuna' extra. Install with `pip install doubleml[optuna]`.","severity":"gotcha","affected_versions":">=0.11.1"},{"fix":"Convert lists to numpy arrays or pandas objects before passing to DoubleMLData.","message":"DoubleMLData constructor expects numpy arrays or pandas DataFrame/Series. Passing raw lists may cause errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Change import to `from doubleml import DoubleMLData`.","cause":"DoubleMLData was moved to the top-level `doubleml` package in v0.10.0.","error":"ImportError: cannot import name 'DoubleMLData' from 'doubleml.data'"},{"fix":"Ensure correct spelling: `from doubleml import DoubleMLPLR` for partially linear regression model.","cause":"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).","error":"ImportError: cannot import name 'DoubleMLPLR' from 'doubleml'"},{"fix":"Use `model.nuisance_loss` instead of `model.rmses`.","cause":"The `rmses` property was renamed to `nuisance_loss` in v0.8.2.","error":"AttributeError: 'DoubleMLPLR' object has no attribute 'rmses'"},{"fix":"Ensure treatment variable is binary, or use a multi-class classifier like `RandomForestClassifier`.","cause":"LogisticRegressionCV only works for binary treatment. For multi-category treatment, use a different classifier or treat treatment as continuous.","error":"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."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}