Created base structure for adding discovery and other algorithms#68
Conversation
Signed-off-by: Amit Sharma <amit_sharma@live.com>
There was a problem hiding this comment.
Pull Request Overview
This PR establishes the foundational structure for a causal discovery library by creating base interfaces and utility functions. The changes introduce a protocol-based design for datasets and skeleton implementations for evaluation metrics.
- Defines a
Datasetprotocol with methods for graph access, data retrieval, and synthetic data generation - Creates placeholder functions for standard causal discovery evaluation metrics (accuracy, precision, recall, F1)
Reviewed Changes
Copilot reviewed 2 out of 8 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pywhyllm/datasets/dataset.py | Defines the Dataset protocol interface with methods for graph, data, and synthetic data generation |
| pywhyllm/datasets/metrics.py | Creates skeleton functions for evaluation metrics used in causal discovery |
Comments suppressed due to low confidence (1)
pywhyllm/datasets/metrics.py:21
- Function name 'F1' should follow Python naming conventions. Consider renaming to 'f1_score' or 'f1' (lowercase).
def F1(edges, true_edges)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Amit Sharma <amshar@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Amit Sharma <amshar@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Amit Sharma <amshar@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Amit Sharma <amshar@microsoft.com>
emrekiciman
left a comment
There was a problem hiding this comment.
This is great. I added a few questions about the structure.
Also: do we want this dataset protocol to integrate well with data handling in other pywhyllm libraries? Or is this only for self-contained pywhy-llm benchmarking for example?
Signed-off-by: Amit Sharma <amit_sharma@live.com>
thanks for the feedback, @emrekiciman . Currently, dowhy expects a pandas dataframe and a Networkx graph (separately). This dataset class is pywhyllm-specific but can be easily used to provide input to dowhy by accessing its members, Addressed other comments inline. |
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
New files added that convey the directory structure.
This PR does not add any functionality, just the protocol class and structure. The goal is to enable collaborators to contribute code.