Skip to content
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

revise the causal explanation notebook, added test #447

Draft
wants to merge 64 commits into
base: master
Choose a base branch
from

Conversation

rfl-urbaniak
Copy link
Collaborator

Updating the notebook in light of the refactoring.

rfl-urbaniak and others added 10 commits December 6, 2023 08:54
* added preempt and its tests

* refactored test to use new code

* lint
* added preempt and its tests

* refactored test to use new code

* lint

* added consequent_differs and a test thereof

---------

Co-authored-by: eb8680 <eb8680@users.noreply.github.com>
* added preempt and its tests

* refactored test to use new code

* lint

* added Preemptions and a test thereof

* added `undo_split` and a test thereof (#422)

* import

---------

Co-authored-by: Eli <eli@elibingham.com>
* added preempt and its tests

* refactored test to use new code

* lint

* added Preemptions and a test thereof

* added `undo_split` and a test thereof

* added SplitSubsets and a test thereof

* added `undo_split` and a test thereof (#422)

* import

---------

Co-authored-by: Eli <eli@elibingham.com>
Co-authored-by: eb8680 <eb8680@users.noreply.github.com>
@rfl-urbaniak rfl-urbaniak requested a review from eb8680 December 8, 2023 10:35
@rfl-urbaniak rfl-urbaniak added the status:awaiting review Awaiting response from reviewer label Dec 8, 2023
rfl-urbaniak and others added 2 commits December 8, 2023 10:31
* added `random intervention` and a test thereof

* added `SearchForExplanation` and a test thereof

---------

Co-authored-by: eb8680 <eb8680@users.noreply.github.com>
Base automatically changed from ru-search-for-explanation to staging-causality December 8, 2023 16:01
rfl-urbaniak and others added 10 commits December 11, 2023 07:22
* docstrings update WIP

* small typo
* add soft_neq and a few tests in test_ops

* sof eq WIP

* conversion to soft_eq

* defaulting soft_eq scale to .1

* Tavares conditions have landed

* soft_neq with tests

* added docstring for soft_neq

* refactor soft_eq and soft_neq

* tests

* remove failing tests

* comment

* sign

* move soft_neq to internals for now

* nit

* remove comment

---------

Co-authored-by: Eli <eli@elibingham.com>
* Add explainable module to sphinx build

* Add explainable module to sphinx build
* Add explainable module to sphinx build

* Add explainable module to sphinx build

* reorganize codebase

* remove empty file

* rename alternatives

* reorganize test files

* sphinx

* remove test_defaults
@rfl-urbaniak rfl-urbaniak added the status:awaiting review Awaiting response from reviewer label Jan 10, 2024
Copy link
Contributor

@eb8680 eb8680 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the role of the condition_on_consequent argument to ExplanationEvaluation in the notebook, and why it's set to False throughout? I thought you always wanted to condition on the consequents in the factual world, since otherwise there's nothing to explain.

@eb8680 eb8680 added status:awaiting response Awaiting response from creator and removed status:awaiting review Awaiting response from reviewer labels Jan 11, 2024
@rfl-urbaniak
Copy link
Collaborator Author

Added the following explanation:

In principle, we want to be able to condition on the observed consequents: as whatever happened to the consequents is what we want to explain. On the other hand, some of the conditions in the original definition involve queries in the unconditioned model (e.g., are the consequents different always if we intervene on a given candidate cause?) In a more general setting to mimic the definition from the book we would need to have two separate model runs, with and without conditioning and run inference to propagate the results of the conditioning. In this context, when we're dealing with not too many discrete variables, we can proceed in a simplified manner and get away with running forward with an unconditioned model. The conditioning on the consequent is then delegated to trace handling for those parts of the definition that require conditioning. We will emphasize this element of trace handling conditioning in a comment when it happens.

@rfl-urbaniak rfl-urbaniak added status:awaiting review Awaiting response from reviewer and removed status:awaiting response Awaiting response from creator labels Jan 11, 2024
@eb8680 eb8680 added the blocked label Jan 12, 2024
@eb8680
Copy link
Contributor

eb8680 commented Jan 12, 2024

Let's land #441 first. I'm not entirely convinced by that reasoning about conditioning on consequents, but this notebook doesn't need to block #441.

@eb8680 eb8680 removed the blocked label Jan 12, 2024
@eb8680 eb8680 changed the base branch from staging-causality to master January 12, 2024 15:19
@eb8680
Copy link
Contributor

eb8680 commented Jan 12, 2024

@rfl-urbaniak can you resolve these new merge conflicts?

@eb8680 eb8680 added the blocked label Jan 12, 2024
@eb8680 eb8680 removed the blocked label Jan 12, 2024
@SamWitty
Copy link
Collaborator

@rfl-urbaniak and @eb8680 , what is the current status of this PR? I have some spare cycles if you'd like my help reviewing.

@SamWitty SamWitty added status:WIP Work-in-progress not yet ready for review and removed status:awaiting review Awaiting response from reviewer labels Apr 25, 2024
@SamWitty SamWitty marked this pull request as draft April 25, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:explainable status:WIP Work-in-progress not yet ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants