From 4716039b98a383002e559a8867c85002a751db9a Mon Sep 17 00:00:00 2001 From: SvenKlaassen Date: Wed, 10 Dec 2025 11:00:13 +0100 Subject: [PATCH 1/5] Fix: Inherit from BaseEstimator in _DummyNoSetParams class for compatibility with scikit-learn --- doubleml/plm/tests/test_lplr_exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doubleml/plm/tests/test_lplr_exceptions.py b/doubleml/plm/tests/test_lplr_exceptions.py index 404770fa..11b031c6 100644 --- a/doubleml/plm/tests/test_lplr_exceptions.py +++ b/doubleml/plm/tests/test_lplr_exceptions.py @@ -156,7 +156,7 @@ def test_lplr_exception_set_ml_nuisance_params(): dml_lplr.set_ml_nuisance_params("ml_M", "y", {"alpha": 0.1}) -class _DummyNoSetParams: +class _DummyNoSetParams(BaseEstimator): def fit(self): pass From 0378ee6aebb1afe82f84274b7aac65ecf07012e6 Mon Sep 17 00:00:00 2001 From: SvenKlaassen Date: Wed, 10 Dec 2025 11:13:32 +0100 Subject: [PATCH 2/5] Fix: Remove deprecated 'multi_class' parameter from LogisticRegression instantiation --- doubleml/tests/test_optuna_multi_wrappers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doubleml/tests/test_optuna_multi_wrappers.py b/doubleml/tests/test_optuna_multi_wrappers.py index d484b4ef..332fd6cb 100644 --- a/doubleml/tests/test_optuna_multi_wrappers.py +++ b/doubleml/tests/test_optuna_multi_wrappers.py @@ -23,7 +23,7 @@ def _build_apos_object(): dml_data = dml.DoubleMLData(df, "y", "d") ml_g = LinearRegression() - ml_m = LogisticRegression(max_iter=200, multi_class="auto") + ml_m = LogisticRegression(max_iter=200) return dml.DoubleMLAPOS( dml_data, @@ -38,7 +38,7 @@ def _build_apos_object(): def _build_qte_object(): np.random.seed(3141) dml_data = make_irm_data(n_obs=80, dim_x=5) - ml = LogisticRegression(max_iter=200, multi_class="auto") + ml = LogisticRegression(max_iter=200) return dml.DoubleMLQTE( dml_data, @@ -57,7 +57,7 @@ def _build_did_multi_object(): dml_panel = DoubleMLPanelData(df, y_col="y", d_cols="d", t_col="t", id_col="id", x_cols=x_cols) ml_g = LinearRegression() - ml_m = LogisticRegression(max_iter=200, multi_class="auto") + ml_m = LogisticRegression(max_iter=200) return dml.did.DoubleMLDIDMulti( obj_dml_data=dml_panel, From 76c362e6daf4273a082762b36d5aa589ca76f9c5 Mon Sep 17 00:00:00 2001 From: SvenKlaassen Date: Wed, 10 Dec 2025 12:00:51 +0100 Subject: [PATCH 3/5] Fix: Update lightgbm dependency to version 4.6.0 in development requirements --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a3fe2414..d250d494 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ dev = [ "pytest>=8.3.0", "pytest-cov>=6.0.0", "xgboost>=2.1.0", - "lightgbm>=4.5.0", + "lightgbm>=4.6.0", "black>=25.1.0", "ruff>=0.11.1", "pre-commit>=4.2.0", From ce18553c9531c8e56800d55ebbf0de4326d902d7 Mon Sep 17 00:00:00 2001 From: SvenKlaassen Date: Wed, 10 Dec 2025 12:00:59 +0100 Subject: [PATCH 4/5] Fix: Remove inheritance from BaseEstimator in _DummyNoSetParams class --- doubleml/plm/tests/test_lplr_exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doubleml/plm/tests/test_lplr_exceptions.py b/doubleml/plm/tests/test_lplr_exceptions.py index 11b031c6..404770fa 100644 --- a/doubleml/plm/tests/test_lplr_exceptions.py +++ b/doubleml/plm/tests/test_lplr_exceptions.py @@ -156,7 +156,7 @@ def test_lplr_exception_set_ml_nuisance_params(): dml_lplr.set_ml_nuisance_params("ml_M", "y", {"alpha": 0.1}) -class _DummyNoSetParams(BaseEstimator): +class _DummyNoSetParams: def fit(self): pass From 4343f3e39141e8c2585092e947905cd51277864e Mon Sep 17 00:00:00 2001 From: SvenKlaassen Date: Wed, 10 Dec 2025 13:18:17 +0100 Subject: [PATCH 5/5] Fix: Update test to use Lasso as invalid learner for ml_M in DoubleMLLPLR --- doubleml/plm/tests/test_lplr_exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doubleml/plm/tests/test_lplr_exceptions.py b/doubleml/plm/tests/test_lplr_exceptions.py index 404770fa..c58d7aa0 100644 --- a/doubleml/plm/tests/test_lplr_exceptions.py +++ b/doubleml/plm/tests/test_lplr_exceptions.py @@ -241,7 +241,7 @@ def test_lplr_exception_learner(): def test_lplr_exception_and_warning_learner(): # invalid ml_M (must be a classifier with predict_proba) with pytest.raises(TypeError): - _ = DoubleMLLPLR(dml_data, _DummyNoClassifier(), ml_t, ml_m) + _ = DoubleMLLPLR(dml_data, Lasso(), ml_t, ml_m) msg = "Invalid learner provided for ml_M: " + r"Lasso\(\) has no method .predict_proba\(\)." with pytest.raises(TypeError, match=msg): _ = DoubleMLLPLR(dml_data, Lasso(), ml_t, ml_m)