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

Graph repair based on conditional independences in data #163

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/y0/algorithm/repair.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Data-driven graph repair."""

from y0.graph import NxMixedGraph
import pandas as pd
from y0.algorithm.conditional_independencies import get_conditional_independencies
from y0.algorithm.falsification import get_graph_falsifications

__all__ = [
"repair_graph",
]


def repair_graph(graph: NxMixedGraph, data: pd.DataFrame) -> NxMixedGraph:
"""Repair the graph based on calculatable conditional dependencies in the data."""
falsifications = get_graph_falsifications(graph=graph, df=data)
d_separations = get_conditional_independencies(graph)
raise NotImplementedError
17 changes: 17 additions & 0 deletions tests/test_algorithm/test_repair.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Data-driven graph repair."""

import unittest
from y0.algorithm.repair import repair_graph
from y0.graph import NxMixedGraph
import pandas as pd

class TestRepair(unittest.TestCase):
"""Test case for data-driven graph repair."""

def test_repair(self):
graph: NxMixedGraph = ...
data:pd.DataFrame = ...
new_graph = repair_graph(graph=graph, data=data)

# TODO implement test
raise NotImplementedError