Skip to content

Remove apply_crossfitting and dml_procedure options from DoubleML class #227

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

Merged
merged 68 commits into from
Mar 26, 2024

Conversation

SvenKlaassen
Copy link
Member

@SvenKlaassen SvenKlaassen commented Jan 19, 2024

Comments

Remove the options apply_crossfitting and dml_procedure.
dml1 is not used and crossfitting should generally be done (if not wanted the predictions can still be generated externally)
Further, removed the boot_coef attribute as the name is slightly misleading and it is not required for bootstrapped confidence intervals.

Simplify the fit() implementation.

PR Checklist

  • The title of the pull request summarizes the changes made.
  • The PR contains a detailed description of all changes and additions.
  • References to related issues or PRs are added.
  • The code passes all (unit) tests.
  • Enhancements or new feature are equipped with unit tests.
  • The changes adhere to the PEP8 standards.

@@ -134,6 +120,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

Assignment overwrites attribute _strata, which was previously defined in superclass [DoubleML](1).
@@ -153,6 +145,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

Assignment overwrites attribute _strata, which was previously defined in superclass [DoubleML](1).
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

Assignment overwrites attribute _external_predictions_implemented, which was previously defined in superclass [DoubleML](1).
@@ -165,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

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute _strata, which was previously defined in superclass [DoubleML](1).
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

Assignment overwrites attribute _external_predictions_implemented, which was previously defined in superclass [DoubleML](1).
@SvenKlaassen SvenKlaassen marked this pull request as ready for review March 26, 2024 06:36
@SvenKlaassen SvenKlaassen merged commit 701fedc into main Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant