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

[ENH] Adding multi-domain functional linear graph and fix bug related to drawing causal graphs #77

Merged
merged 12 commits into from
May 24, 2023

Conversation

adam2392
Copy link
Collaborator

@adam2392 adam2392 commented May 18, 2023

Fixes: #76

Changes proposed in this pull request:

  • add ability to convert linear functional graph into a multiple domain setting

The API leverages the graph dictionary data structure inside it to store metadata about the multi-domain setting:

  • of domains

It also leverages the node_attributes to store the following for linear-graphs for each node:

{
            'X': {
                'parent_functions': {
                    'Y': {
                        'weight': <weight of Y added to X>,
                        'func': <function that takes input Y>,
                    },
                    'Z': {
                        'weight': <weight of Z added to X>,
                        'func': <function that takes input Z>,
                    },
                },
                'gaussian_noise_function': {
                    'mean': <mean of gaussian noise added to X>,
                    'std': <std of gaussian noise added to X>,
                }
            }
        }

Before submitting

  • I've read and followed all steps in the Making a pull request
    section of the CONTRIBUTING docs.
  • I've updated or added any relevant docstrings following the syntax described in the
    Writing docstrings section of the CONTRIBUTING docs.
  • If this PR fixes a bug, I've added a test that will fail without my fix.
  • If this PR adds a new feature, I've added tests that sufficiently cover my new functionality.

After submitting

  • All GitHub Actions jobs for my pull request have passed.

@codecov-commenter
Copy link

Codecov Report

Merging #77 (ade5c07) into main (3de911e) will decrease coverage by 4.58%.
The diff coverage is 41.88%.

@@            Coverage Diff             @@
##             main      #77      +/-   ##
==========================================
- Coverage   84.59%   80.02%   -4.58%     
==========================================
  Files          35       39       +4     
  Lines        2590     2838     +248     
  Branches      698      759      +61     
==========================================
+ Hits         2191     2271      +80     
- Misses        247      408     +161     
- Partials      152      159       +7     
Impacted Files Coverage Δ
pywhy_graphs/functional/multidomain.py 11.57% <11.57%> (ø)
pywhy_graphs/algorithms/multidomain.py 50.00% <50.00%> (ø)
pywhy_graphs/classes/augmented.py 69.42% <54.23%> (ø)
pywhy_graphs/functional/utils.py 56.52% <56.52%> (ø)
pywhy_graphs/functional/linear.py 66.66% <57.69%> (-19.05%) ⬇️
pywhy_graphs/viz/draw.py 76.92% <66.66%> (+3.58%) ⬆️
pywhy_graphs/functional/additive.py 76.47% <76.47%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@adam2392 adam2392 changed the title [DRAFT, ENH] Adding multi-domain functional linear graph [ENH] Adding multi-domain functional linear graph and fix bug related to drawing causal graphs May 24, 2023
@adam2392 adam2392 merged commit 2d6f1d3 into py-why:main May 24, 2023
@adam2392 adam2392 deleted the multidomain branch May 24, 2023 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in CPDAG drawing
2 participants