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

[API] Centralize common operations that are used to make Context objects initialize state for learning algos #136

Open
adam2392 opened this issue May 18, 2023 · 0 comments

Comments

@adam2392
Copy link
Collaborator

Currently, for algo.fit(data, context), the data is a pandas dataframe that encodes the dataset for a single domain (or a list of data frames for a multi-distribution setting) and context is a Context object that contains a WIP API to enable causal-learning.

The issue is that it is not exactly clear how we can implement the Context API such that it is modularizable across different learning algorithms. For example, this is already coming up in #129, where some of the node names were being dropped because there is no common way for Context to be used.

We should centralize an abstract BaseLearner for all classes, which maybe initializes state in some way and has a common API that users and developers can rely on. For example:

class BaseLearner:
     # main APIs
     context: Context
     init_graph: Graph
     causal_variables : Set[Node]
    
    def _initialize_learner(self, data, context):
          # which should be called for every learner inside `def fit()`.
          # maybe also handle error-checking

This is a WIP issue to make sure #129 and future PRs can proceed robustly.

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

No branches or pull requests

1 participant