Add example notebook: causal discovery with a foundation model + GCM root cause analysis - #1663
Conversation
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
There was a problem hiding this comment.
Pull request overview
Adds a new advanced documentation example notebook that demonstrates end-to-end causal discovery (via FoundCause) followed by DoWhy GCM analyses (graph falsification, anomaly attribution/root-cause analysis, and distribution-change attribution), and exposes it in the example notebook index.
Changes:
- Adds a new GCM example notebook: causal discovery from observational CSV data using FoundCause, then GCM-based analyses on the discovered graph.
- Updates the example notebook index to feature and include the new notebook in the Real world-inspired examples section.
- Ignores the local FoundCause model cache directory created when running the notebook.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/source/example_notebooks/nb_index.rst | Adds the new notebook to the grid cards and toctree so it appears in the rendered docs. |
| docs/source/example_notebooks/gcm_causal_discovery_foundcause.ipynb | New advanced notebook demonstrating causal discovery + GCM analyses on a simulated bottling-line scenario. |
| .gitignore | Ignores the notebook-created foundcause_model/ cache directory under docs/source/example_notebooks/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Compute checkpoint SHA-256 in chunks to avoid loading 1.6 GB into memory - Clamp line-speed set-point intervention to the five defined levels - Note the PyTorch requirement in the download warning Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
|
@emrekiciman any concerns left? |
|
🤖 This is an automated response from Repo Assist. This is a really compelling addition — a complete end-to-end causal analysis pipeline from observational data using a foundation model for structure learning is exactly the kind of showcase example that will help new users appreciate the power of combining GCM with modern causal discovery. A few observations worth discussing before merge: Dependencies / setup: FoundCause is not part of DoWhy's standard extras. The notebook presumably requires a CI / notebook execution: The notebook tests job in CI runs all notebooks in Minor nit: The Great contribution from the FoundCause team — this showcases a genuinely useful workflow. Happy to see it merged once the CI question is resolved.
|
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
emrekiciman
left a comment
There was a problem hiding this comment.
nice notebook. stepped through and it ran well on a clean install, was easy to understand. thanks for making the additional edits to emphasize that the foundcause output requires validation before use.
…root cause analysis (#1663) * docs: add GCM notebook using FoundCause for causal discovery Signed-off-by: Patrick Bloebaum <bloebp@amazon.com> * docs: address review feedback on FoundCause notebook - Compute checkpoint SHA-256 in chunks to avoid loading 1.6 GB into memory - Clamp line-speed set-point intervention to the five defined levels - Note the PyTorch requirement in the download warning Signed-off-by: Patrick Bloebaum <bloebp@amazon.com> * docs: add validation and assumption disclaimers to FoundCause notebook Signed-off-by: Patrick Bloebaum <bloebp@amazon.com> --------- Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
…root cause analysis (#1663) * docs: add GCM notebook using FoundCause for causal discovery Signed-off-by: Patrick Bloebaum <bloebp@amazon.com> * docs: address review feedback on FoundCause notebook - Compute checkpoint SHA-256 in chunks to avoid loading 1.6 GB into memory - Clamp line-speed set-point intervention to the five defined levels - Note the PyTorch requirement in the download warning Signed-off-by: Patrick Bloebaum <bloebp@amazon.com> * docs: add validation and assumption disclaimers to FoundCause notebook Signed-off-by: Patrick Bloebaum <bloebp@amazon.com> --------- Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
Adds a new GCM example notebook showing that a plain CSV of observational data is sufficient for a full causal analysis: the causal graph is inferred with FoundCause, a pretrained foundation model for causal discovery (see Paper), and DoWhy's GCM module runs the analyses on the discovered graph.
The scenario is a simulated bottling line (ground truth via DoWhy's random SCM generator, including a hidden confounder), covering graph discovery, falsification with falsify_graph, root cause analysis of a defect spike and distribution-change attribution of a throughput drop.