Skip to content

Commit 1e792bc

Browse files
authored
Merge pull request #113 from DoubleML/m-prevent-warning-by-initial-with-nan
by initializing with nan instead of zero, we no longer get divide by zero warnings when running IRM with ATTE score without cross-fitting
2 parents 78df0e3 + d4abb2b commit 1e792bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doubleml/double_ml_irm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def _score_elements(self, y, d, g_hat0, g_hat1, m_hat, smpls):
192192
# fraction of treated for ATTE
193193
p_hat = None
194194
if self.score == 'ATTE':
195-
p_hat = np.zeros_like(d, dtype='float64')
195+
p_hat = np.full_like(d, np.nan, dtype='float64')
196196
for _, test_index in smpls:
197197
p_hat[test_index] = np.mean(d[test_index])
198198

0 commit comments

Comments
 (0)