Core impl [Graph Role + base identification]#27
Merged
ankurankan merged 2 commits intopgmpy:mainfrom Sep 15, 2025
Merged
Conversation
Member
|
@mdrazak2001 Sorry for the delay on the end-to-end example. A simple end-to-end example could be a DAG: We can create a similar example in the case of a PDAG by adding another node Z: let mut dag = RustDAG::new();
dag.add_edges_from([("X".to_string(), "Y".to_string()),
("U".to_string(), "X".to_string()),
("U".to_string(), "Y".to_string())]);
dag = dag.with_role("exposure".to_string(), "X".to_string());
dag = dag.with_role("outcome".to_string(), "Y".to_string());
let identification = BackdoorIdentification::new();
let dag_with_roles = identification.identify(dag)
// Similarly for the PDAG case.
let pdag_with_roles = identification.identify(pdag)
dag_with_roles.get_role_dict()
// this should have U as adjustment. |
ankurankan
approved these changes
Sep 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Your checklist for this pull request
Please review the guidelines for contributing to this repository.
Issue number(s) that this pull request fixes
List of changes to the codebase in this pull request