-
Notifications
You must be signed in to change notification settings - Fork 88
Restructure doubleml #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure doubleml #225
Conversation
@@ -134,6 +133,11 @@ | |||
y_treat = self._dml_data.y[self._dml_data.d == self.treatment] | |||
self._coef_start_val = np.mean(y_treat[y_treat >= np.quantile(y_treat, self.quantile)]) | |||
|
|||
# set stratication for resampling | |||
self._strata = self._dml_data.d |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
@@ -153,6 +152,13 @@ | |||
self._coef_bounds = (self._dml_data.y.min(), self._dml_data.y.max()) | |||
self._coef_start_val = np.quantile(self._dml_data.y[self._dml_data.d == self.treatment], self.quantile) | |||
|
|||
# set stratication for resampling | |||
self._strata = self._dml_data.d.reshape(-1, 1) + 2 * self._dml_data.z.reshape(-1, 1) |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
if draw_sample_splitting: | ||
self.draw_sample_splitting() | ||
|
||
self._external_predictions_implemented = True |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
@@ -165,6 +164,13 @@ | |||
self._coef_bounds = (self._dml_data.y.min(), self._dml_data.y.max()) | |||
self._coef_start_val = np.quantile(self._dml_data.y[self._dml_data.d == self.treatment], self.quantile) | |||
|
|||
# set stratication for resampling | |||
self._strata = self._dml_data.d |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
if draw_sample_splitting: | ||
self.draw_sample_splitting() | ||
|
||
self._external_predictions_implemented = True |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class
@@ -201,13 +204,16 @@ | |||
u_hat0, u_hat1, w_hat0, w_hat1, g_hat0, g_hat1, m_hat, r_hat0, r_hat1 = compute_iivm_residuals( | |||
y, d, g_hat0_list, g_hat1_list, m_hat_list, r_hat0_list, r_hat1_list, smpls) | |||
|
|||
m_hat_adj = np.full_like(m_hat, np.nan, dtype='float64') |
Check warning
Code scanning / CodeQL
Variable defined multiple times
Restructure the package to have a good overview by creating several subpackages.
fix bugs: