-
Notifications
You must be signed in to change notification settings - Fork 12
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
Attempt to modularize AC query code #240
Conversation
antecedent_handler = PartOfCause( | ||
antecedents, bias=antecedent_bias, prefix="__antecedent_" | ||
) | ||
treatment_handler = PartOfCause( | ||
treatments, bias=treatment_bias, prefix="__treatment_" | ||
) |
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.
I'm a little unsure about this pair of PartOfCause
handlers. It's not clear to me whether they're correctly encoding the relevant portion of the textbook definition.
if antecedents is None: | ||
antecedents_ = list(indices_of(value, event_dim=event_dim).keys()) |
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.
Note the new default behavior of factual_preemption
(previously preempt_with_factual
) here. This is not exercised in the query code below or the pair of unit tests for PartOfCause
initially included with this PR, and may be assuming too much about the free variables of value
. I may remove or revert this before a version of factual_preemption
lands in master
.
Closing this now that PRs for all of the components except |
Part of modularizing and simplifying #236 #164
Targets #236, not
master
Depends on #238 #239
This PR is an attempt at simplifying the query code from @rfl-urbaniak's notebooks and turning it into library code. It attempts to be faithful to the notebooks, although after going through this exercise I have some new questions about the relationships between the textbook definitions and the latest query code in #236.
Only the changes in the new files
chirho/counterfactual/handlers/explanation.py
andtest/counterfactual/test_handlers_explanation.py
are new here. The others are merged from #238 and #239 and should land inmaster
relatively soon.