Skip to content

Commit 6c5abb7

Browse files
authored
Merge pull request #361 from DoubleML/s-update-dependencies
Update dependencies
2 parents a37e8ea + c8054fd commit 6c5abb7

File tree

21 files changed

+101
-130
lines changed

21 files changed

+101
-130
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/doubleml.svg)](https://anaconda.org/conda-forge/doubleml)
66
[![codecov](https://codecov.io/gh/DoubleML/doubleml-for-py/branch/main/graph/badge.svg?token=0BjlFPgdGk)](https://codecov.io/gh/DoubleML/doubleml-for-py)
77
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/1c08ec7d782c451784293c996537de14)](https://www.codacy.com/gh/DoubleML/doubleml-for-py/dashboard?utm_source=github.com&utm_medium=referral&utm_content=DoubleML/doubleml-for-py&utm_campaign=Badge_Grade)
8-
[![Python version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/)
8+
[![Python version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/)
99

1010
The Python package **DoubleML** provides an implementation of the double / debiased machine learning framework of
1111
[Chernozhukov et al. (2018)](https://doi.org/10.1111/ectj.12097).

doubleml/data/base_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ def from_arrays(
286286
elif not isinstance(force_all_d_finite, bool):
287287
raise TypeError("Invalid force_all_d_finite. " + "force_all_d_finite must be True, False or 'allow-nan'.")
288288

289-
x = check_array(x, ensure_2d=False, allow_nd=False, force_all_finite=force_all_x_finite)
290-
d = check_array(d, ensure_2d=False, allow_nd=False, force_all_finite=force_all_x_finite)
289+
x = check_array(x, ensure_2d=False, allow_nd=False, ensure_all_finite=force_all_x_finite)
290+
d = check_array(d, ensure_2d=False, allow_nd=False, ensure_all_finite=force_all_x_finite)
291291
y = column_or_1d(y, warn=True)
292292

293293
x = _assure_2d_array(x)

doubleml/did/did.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ def _check_data(self, obj_dml_data):
201201
return
202202

203203
def _nuisance_est(self, smpls, n_jobs_cv, external_predictions, return_models=False):
204-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
205-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
204+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
205+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
206206

207207
# nuisance g
208208
# get train indices for d == 0
@@ -372,8 +372,8 @@ def _sensitivity_element_est(self, preds):
372372
def _nuisance_tuning(
373373
self, smpls, param_grids, scoring_methods, n_folds_tune, n_jobs_cv, search_mode, n_iter_randomized_search
374374
):
375-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
376-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
375+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
376+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
377377
# get train indices for d == 0 and d == 1
378378
smpls_d0, smpls_d1 = _get_cond_smpls(smpls, d)
379379

doubleml/did/did_binary.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ def _preprocess_data(self, g_value, pre_t, eval_t):
429429
def _nuisance_est(self, smpls, n_jobs_cv, external_predictions, return_models=False):
430430

431431
# Here: d is a binary treatment indicator
432-
x, y = check_X_y(self._x_data_subset, self._y_data_subset, force_all_finite=False)
433-
x, d = check_X_y(x, self._g_data_subset, force_all_finite=False)
432+
x, y = check_X_y(self._x_data_subset, self._y_data_subset, ensure_all_finite=False)
433+
x, d = check_X_y(x, self._g_data_subset, ensure_all_finite=False)
434434
# nuisance g
435435
# get train indices for d == 0
436436
smpls_d0, smpls_d1 = _get_cond_smpls(smpls, d)
@@ -570,8 +570,8 @@ def _score_elements(self, y, d, g_hat0, g_hat1, m_hat, p_hat):
570570
def _nuisance_tuning(
571571
self, smpls, param_grids, scoring_methods, n_folds_tune, n_jobs_cv, search_mode, n_iter_randomized_search
572572
):
573-
x, y = check_X_y(self._x_data_subset, self._y_data_subset, force_all_finite=False)
574-
x, d = check_X_y(x, self._g_data_subset, force_all_finite=False)
573+
x, y = check_X_y(self._x_data_subset, self._y_data_subset, ensure_all_finite=False)
574+
x, d = check_X_y(x, self._g_data_subset, ensure_all_finite=False)
575575

576576
# get train indices for d == 0 and d == 1
577577
smpls_d0, smpls_d1 = _get_cond_smpls(smpls, d)

doubleml/did/did_cs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ def _check_data(self, obj_dml_data):
212212
return
213213

214214
def _nuisance_est(self, smpls, n_jobs_cv, external_predictions, return_models=False):
215-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
216-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
217-
x, t = check_X_y(x, self._dml_data.t, force_all_finite=False)
215+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
216+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
217+
x, t = check_X_y(x, self._dml_data.t, ensure_all_finite=False)
218218

219219
# THIS DIFFERS FROM THE PAPER due to stratified splitting this should be the same for each fold
220220
# nuisance estimates of the uncond. treatment prob.
@@ -547,9 +547,9 @@ def _sensitivity_element_est(self, preds):
547547
def _nuisance_tuning(
548548
self, smpls, param_grids, scoring_methods, n_folds_tune, n_jobs_cv, search_mode, n_iter_randomized_search
549549
):
550-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
551-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
552-
x, t = check_X_y(x, self._dml_data.t, force_all_finite=False)
550+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
551+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
552+
x, t = check_X_y(x, self._dml_data.t, ensure_all_finite=False)
553553

554554
if scoring_methods is None:
555555
scoring_methods = {"ml_g": None, "ml_m": None}

doubleml/did/did_cs_binary.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ def _estimate_conditional_g(
435435
def _nuisance_est(self, smpls, n_jobs_cv, external_predictions, return_models=False):
436436

437437
# Here: d is a binary treatment indicator
438-
x, y = check_X_y(X=self._x_data_subset, y=self._y_data_subset, force_all_finite=False)
439-
_, d = check_X_y(x, self._g_data_subset, force_all_finite=False) # (d is the G_indicator)
440-
_, t = check_X_y(x, self._t_data_subset, force_all_finite=False)
438+
x, y = check_X_y(X=self._x_data_subset, y=self._y_data_subset, ensure_all_finite=False)
439+
_, d = check_X_y(x, self._g_data_subset, ensure_all_finite=False) # (d is the G_indicator)
440+
_, t = check_X_y(x, self._t_data_subset, ensure_all_finite=False)
441441

442442
# THIS DIFFERS FROM THE PAPER due to stratified splitting this should be the same for each fold
443443
# nuisance estimates of the uncond. treatment prob.
@@ -621,9 +621,9 @@ def _score_elements(self, y, d, t, g_hat_d0_t0, g_hat_d0_t1, g_hat_d1_t0, g_hat_
621621
def _nuisance_tuning(
622622
self, smpls, param_grids, scoring_methods, n_folds_tune, n_jobs_cv, search_mode, n_iter_randomized_search
623623
):
624-
x, y = check_X_y(X=self._x_data_subset, y=self._y_data_subset, force_all_finite=False)
625-
_, d = check_X_y(x, self._g_data_subset, force_all_finite=False) # (d is the G_indicator)
626-
_, t = check_X_y(x, self._t_data_subset, force_all_finite=False)
624+
x, y = check_X_y(X=self._x_data_subset, y=self._y_data_subset, ensure_all_finite=False)
625+
_, d = check_X_y(x, self._g_data_subset, ensure_all_finite=False) # (d is the G_indicator)
626+
_, t = check_X_y(x, self._t_data_subset, ensure_all_finite=False)
627627

628628
if scoring_methods is None:
629629
scoring_methods = {"ml_g": None, "ml_m": None}

doubleml/did/tests/test_did_aggregation_plot.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import warnings
2-
31
import matplotlib.pyplot as plt
42
import numpy as np
53
import pytest
@@ -180,13 +178,4 @@ def test_joint_ci_bootstrap_warning(mock_framework):
180178
with pytest.warns(UserWarning, match="Joint confidence intervals require bootstrapping"):
181179
_ = aggregation.plot_effects(joint=True)
182180

183-
# Verify that bootstrap was performed
184-
assert aggregation.aggregated_frameworks.boot_t_stat is not None
185-
186-
# No warning should be raised when plotting again
187-
with warnings.catch_warnings(record=True) as recorded_warnings:
188-
warnings.simplefilter("always") # Ensure all warnings are recorded
189-
_ = aggregation.plot_effects(joint=True)
190-
191-
assert len(recorded_warnings) == 0
192181
plt.close("all")

doubleml/irm/apo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ def _get_weights(self):
208208
return weights, weights_bar
209209

210210
def _nuisance_est(self, smpls, n_jobs_cv, external_predictions, return_models=False):
211-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
212-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
211+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
212+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
213213
dx = np.column_stack((d, x))
214214
# use the treated indicator to get the correct sample splits
215215
treated = self.treated
@@ -361,8 +361,8 @@ def _sensitivity_element_est(self, preds):
361361
def _nuisance_tuning(
362362
self, smpls, param_grids, scoring_methods, n_folds_tune, n_jobs_cv, search_mode, n_iter_randomized_search
363363
):
364-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
365-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
364+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
365+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
366366
dx = np.column_stack((d, x))
367367
# use the treated indicator to get the correct sample splits
368368
treated = self.treated

doubleml/irm/cvar.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ def _initialize_ml_nuisance_params(self):
204204
self._params = {learner: {key: [None] * self.n_rep for key in self._dml_data.d_cols} for learner in ["ml_g", "ml_m"]}
205205

206206
def _nuisance_est(self, smpls, n_jobs_cv, external_predictions, return_models=False):
207-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
208-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
207+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
208+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
209209

210210
# initialize nuisance predictions, targets and models
211211
g_hat = {
@@ -330,8 +330,8 @@ def ipw_score(theta):
330330
def _nuisance_tuning(
331331
self, smpls, param_grids, scoring_methods, n_folds_tune, n_jobs_cv, search_mode, n_iter_randomized_search
332332
):
333-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
334-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
333+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
334+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
335335

336336
if scoring_methods is None:
337337
scoring_methods = {"ml_g": None, "ml_m": None}

doubleml/irm/iivm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ def _check_data(self, obj_dml_data):
263263
return
264264

265265
def _nuisance_est(self, smpls, n_jobs_cv, external_predictions, return_models=False):
266-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
267-
x, z = check_X_y(x, np.ravel(self._dml_data.z), force_all_finite=False)
268-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
266+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
267+
x, z = check_X_y(x, np.ravel(self._dml_data.z), ensure_all_finite=False)
268+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
269269

270270
# get train indices for z == 0 and z == 1
271271
smpls_z0, smpls_z1 = _get_cond_smpls(smpls, z)
@@ -448,9 +448,9 @@ def _score_elements(self, y, z, d, g_hat0, g_hat1, m_hat, r_hat0, r_hat1, smpls)
448448
def _nuisance_tuning(
449449
self, smpls, param_grids, scoring_methods, n_folds_tune, n_jobs_cv, search_mode, n_iter_randomized_search
450450
):
451-
x, y = check_X_y(self._dml_data.x, self._dml_data.y, force_all_finite=False)
452-
x, z = check_X_y(x, np.ravel(self._dml_data.z), force_all_finite=False)
453-
x, d = check_X_y(x, self._dml_data.d, force_all_finite=False)
451+
x, y = check_X_y(self._dml_data.x, self._dml_data.y, ensure_all_finite=False)
452+
x, z = check_X_y(x, np.ravel(self._dml_data.z), ensure_all_finite=False)
453+
x, d = check_X_y(x, self._dml_data.d, ensure_all_finite=False)
454454

455455
# get train indices for z == 0 and z == 1
456456
smpls_z0, smpls_z1 = _get_cond_smpls(smpls, z)

0 commit comments

Comments
 (0)