Skip to content

Commit 13080e1

Browse files
committed
fix docstring examples in set_sample_splitting method
1 parent bbcbedf commit 13080e1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

doubleml/double_ml_sampling_mixins.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,18 @@ def set_sample_splitting(self, all_smpls, all_smpls_cluster=None):
9191
>>> ml_m = learner
9292
>>> obj_dml_data = make_plr_CCDDHNR2018(n_obs=10, alpha=0.5)
9393
>>> dml_plr_obj = dml.DoubleMLPLR(obj_dml_data, ml_g, ml_m)
94-
>>> # simple sample splitting with two folds and without cross-fitting
95-
>>> smpls = ([0, 1, 2, 3, 4], [5, 6, 7, 8, 9])
96-
>>> dml_plr_obj.set_sample_splitting(smpls)
9794
>>> # sample splitting with two folds and cross-fitting
9895
>>> smpls = [([0, 1, 2, 3, 4], [5, 6, 7, 8, 9]),
99-
>>> ([5, 6, 7, 8, 9], [0, 1, 2, 3, 4])]
100-
>>> dml_plr_obj.set_sample_splitting(smpls)
96+
... ([5, 6, 7, 8, 9], [0, 1, 2, 3, 4])]
97+
>>> dml_plr_obj.set_sample_splitting(smpls) # doctest: +ELLIPSIS
98+
<doubleml.plm.plr.DoubleMLPLR object at 0x...>
10199
>>> # sample splitting with two folds and repeated cross-fitting with n_rep = 2
102100
>>> smpls = [[([0, 1, 2, 3, 4], [5, 6, 7, 8, 9]),
103-
>>> ([5, 6, 7, 8, 9], [0, 1, 2, 3, 4])],
104-
>>> [([0, 2, 4, 6, 8], [1, 3, 5, 7, 9]),
105-
>>> ([1, 3, 5, 7, 9], [0, 2, 4, 6, 8])]]
106-
>>> dml_plr_obj.set_sample_splitting(smpls)
101+
... ([5, 6, 7, 8, 9], [0, 1, 2, 3, 4])],
102+
... [([0, 2, 4, 6, 8], [1, 3, 5, 7, 9]),
103+
... ([1, 3, 5, 7, 9], [0, 2, 4, 6, 8])]]
104+
>>> dml_plr_obj.set_sample_splitting(smpls) # doctest: +ELLIPSIS
105+
<doubleml.plm.plr.DoubleMLPLR object at 0x...>
107106
"""
108107
self._smpls, self._smpls_cluster, self._n_rep, self._n_folds = _check_sample_splitting(
109108
all_smpls, all_smpls_cluster, self._dml_data, self._is_cluster_data, n_obs=self._n_obs_sample_splitting

0 commit comments

Comments
 (0)