-
Notifications
You must be signed in to change notification settings - Fork 943
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
[FEA] Support Generalized Adjustment Criterion for Estimation plus Add Example Notebook #1297
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
This will need to be rebased once #1292 merges |
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
estimator_ate.fit(data["df"]) | ||
true_ate = data["ate"] | ||
ate_estimate = estimator_ate.estimate_effect(data["df"]) | ||
error = ate_estimate.value - true_ate | ||
error = abs(ate_estimate.value - true_ate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor bug fix here - taking the absolute value, both here and a few lines down.
Previously the test util would return true if (error < true_ate * self._error_tolerance)
which only makes sense if the error and true_ate are in absolute value (otherwise a negative error would always be accepted no matter how far from zero)
@@ -377,3 +394,22 @@ def randomize_column_values(df, columns): | |||
assert error_3 > error_tolerance | |||
except NotImplementedError: | |||
pass # Expected, for many Estimators | |||
|
|||
|
|||
class TestGraphObject(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is modeled after the graph objects used in the identification test suites (see base.by in the identification test folder).
I added this so that more specific graphs could be tested as needed (which is particularly relevant for testing some of the more involved graphs which really differentiate the general adjustment criterion from the backdoor criterion)
key = self.identifier_method | ||
self.general_adjustment_variables[key] = variables_arr | ||
|
||
def get_adjustment_set(self, key: Optional[str] = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the core change. IdentifiedEstimand now has a generic get_adjustment_set
method which routes to one of get_backdoor_variables
or get_general_adjustment_variables.
The wrapper method get_adjustment_set
should thus be called instead of get_adjustment_set
or get_general_adjustment_variables
throughout the codebase.
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
5e10aff
to
710b045
Compare
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
@amit-sharma - this is a follow on to #1292 to add support for general adjustment for estimation. It is ready for review |
Signed-off-by: Nicholas Parente <parentenickj@gmail.com>
Adds support for the generalized adjustment estimands at the estimation stage. The PR primarily does two things:
An example notebook is also added, dowhy_generalized_covariate_adjustment_estimation_example.ipynb
This is a follow-on PR to #1292
Issue Ref: #402