Skip to content

Commit 1d7c832

Browse files
committed
refactor docstring formatting in DoubleMLDIDCSBinary class for improved readability
1 parent 840fc50 commit 1d7c832

File tree

1 file changed

+55
-55
lines changed

1 file changed

+55
-55
lines changed

doubleml/did/did_cs_binary.py

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -28,78 +28,78 @@
2828

2929

3030
class DoubleMLDIDCSBinary(LinearScoreMixin, DoubleML):
31-
"""Double machine learning for difference-in-differences models with repeated cross sections (binary setting in terms of group and time
32-
combinations).
31+
"""Double machine learning for difference-in-differences models with repeated cross sections
32+
(binary setting in terms of group and time combinations).
3333
34-
Parameters
35-
----------
36-
obj_dml_data : :class:`DoubleMLPanelData` object
37-
The :class:`DoubleMLPanelData` object providing the data and specifying the variables for the causal model.
34+
Parameters
35+
----------
36+
obj_dml_data : :class:`DoubleMLPanelData` object
37+
The :class:`DoubleMLPanelData` object providing the data and specifying the variables for the causal model.
3838
39-
g_value : int
40-
The value indicating the treatment group (first period with treatment).
41-
Default is ``None``. This implements the case for the smallest, non-zero value of G.
39+
g_value : int
40+
The value indicating the treatment group (first period with treatment).
41+
Default is ``None``. This implements the case for the smallest, non-zero value of G.
4242
43-
t_value_pre : int
44-
The value indicating the baseline pre-treatment period.
43+
t_value_pre : int
44+
The value indicating the baseline pre-treatment period.
4545
46-
t_value_eval : int
47-
The value indicating the period for evaluation.
46+
t_value_eval : int
47+
The value indicating the period for evaluation.
4848
49-
ml_g : estimator implementing ``fit()`` and ``predict()``
50-
A machine learner implementing ``fit()`` and ``predict()`` methods (e.g.
51-
:py:class:`sklearn.ensemble.RandomForestRegressor`) for the nuisance function :math:`g_0(d,X) = E[Y_1-Y_0|D=d, X]`.
52-
For a binary outcome variable :math:`Y` (with values 0 and 1), a classifier implementing ``fit()`` and
53-
``predict_proba()`` can also be specified. If :py:func:`sklearn.base.is_classifier` returns ``True``,
54-
``predict_proba()`` is used otherwise ``predict()``.
49+
ml_g : estimator implementing ``fit()`` and ``predict()``
50+
A machine learner implementing ``fit()`` and ``predict()`` methods (e.g.
51+
:py:class:`sklearn.ensemble.RandomForestRegressor`) for the nuisance function :math:`g_0(d,X) = E[Y_1-Y_0|D=d, X]`.
52+
For a binary outcome variable :math:`Y` (with values 0 and 1), a classifier implementing ``fit()`` and
53+
``predict_proba()`` can also be specified. If :py:func:`sklearn.base.is_classifier` returns ``True``,
54+
``predict_proba()`` is used otherwise ``predict()``.
5555
56-
ml_m : classifier implementing ``fit()`` and ``predict_proba()``
57-
A machine learner implementing ``fit()`` and ``predict_proba()`` methods (e.g.
58-
:py:class:`sklearn.ensemble.RandomForestClassifier`) for the nuisance function :math:`m_0(X) = E[D=1|X]`.
59-
Only relevant for ``score='observational'``.
56+
ml_m : classifier implementing ``fit()`` and ``predict_proba()``
57+
A machine learner implementing ``fit()`` and ``predict_proba()`` methods (e.g.
58+
:py:class:`sklearn.ensemble.RandomForestClassifier`) for the nuisance function :math:`m_0(X) = E[D=1|X]`.
59+
Only relevant for ``score='observational'``.
6060
61-
control_group : str
62-
Specifies the control group. Either ``'never_treated'`` or ``'not_yet_treated'``.
63-
Default is ``'never_treated'``.
61+
control_group : str
62+
Specifies the control group. Either ``'never_treated'`` or ``'not_yet_treated'``.
63+
Default is ``'never_treated'``.
6464
65-
anticipation_periods : int
66-
Number of anticipation periods. Default is ``0``.
65+
anticipation_periods : int
66+
Number of anticipation periods. Default is ``0``.
6767
68-
n_folds : int
69-
Number of folds.
70-
Default is ``5``.
68+
n_folds : int
69+
Number of folds.
70+
Default is ``5``.
7171
72-
n_rep : int
73-
Number of repetitions for the sample splitting.
74-
Default is ``1``.
72+
n_rep : int
73+
Number of repetitions for the sample splitting.
74+
Default is ``1``.
7575
76-
score : str
77-
A str (``'observational'`` or ``'experimental'``) specifying the score function.
78-
The ``'experimental'`` scores refers to an A/B setting, where the treatment is independent
79-
from the pretreatment covariates.
80-
Default is ``'observational'``.
76+
score : str
77+
A str (``'observational'`` or ``'experimental'``) specifying the score function.
78+
The ``'experimental'`` scores refers to an A/B setting, where the treatment is independent
79+
from the pretreatment covariates.
80+
Default is ``'observational'``.
8181
82-
in_sample_normalization : bool
83-
Indicates whether to use a slightly different normalization from Sant'Anna and Zhao (2020).
84-
Default is ``True``.
82+
in_sample_normalization : bool
83+
Indicates whether to use a slightly different normalization from Sant'Anna and Zhao (2020).
84+
Default is ``True``.
8585
86-
trimming_rule : str
87-
A str (``'truncate'`` is the only choice) specifying the trimming approach.
88-
Default is ``'truncate'``.
86+
trimming_rule : str
87+
A str (``'truncate'`` is the only choice) specifying the trimming approach.
88+
Default is ``'truncate'``.
8989
90-
trimming_threshold : float
91-
The threshold used for trimming.
92-
Default is ``1e-2``.
90+
trimming_threshold : float
91+
The threshold used for trimming.
92+
Default is ``1e-2``.
9393
94-
draw_sample_splitting : bool
95-
Indicates whether the sample splitting should be drawn during initialization of the object.
96-
Default is ``True``.
94+
draw_sample_splitting : bool
95+
Indicates whether the sample splitting should be drawn during initialization of the object.
96+
Default is ``True``.
9797
98-
print_periods : bool
99-
Indicates whether to print information about the evaluated periods.
100-
Default is ``False``.
98+
print_periods : bool
99+
Indicates whether to print information about the evaluated periods.
100+
Default is ``False``.
101101
102-
"""
102+
"""
103103

104104
def __init__(
105105
self,

0 commit comments

Comments
 (0)