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

Allow more algorithm to use prior knowledge #79

Open
xwbxxx opened this issue Sep 28, 2022 · 5 comments
Open

Allow more algorithm to use prior knowledge #79

xwbxxx opened this issue Sep 28, 2022 · 5 comments

Comments

@xwbxxx
Copy link

xwbxxx commented Sep 28, 2022

Just like the example of PC algorithm,PC demo.py
I hope you can provide interfaces to allow more algorithms to adopt a priori knowledge.
image

@shaido987
Copy link
Collaborator

Hello,

Prior knowledge is something we plan to include in all algorithms in the future (as also mentioned in #72). However, there is no timeline for this as of yet.

@AlxndrMlk
Copy link
Contributor

@shaido987, is there a way to help with this task as a contributor?

@shaido987
Copy link
Collaborator

@AlxndrMlk Any contributions in this direction are very welcome! Prior knowledge can be a bit more difficult to integrate into some of the algorithms as compared with PC. If you want to help you can add it to one or multiple algorithms directly for now, and then we can see if the logic can be abstracted into the base class. Or if you have some suggestions in that direction we can look over them.

@AlxndrMlk
Copy link
Contributor

@shaido987

It seems that there were some attempts to introduce the possibility for adding causal knowledge to DirectLiNGAM (https://github.com/huawei-noah/trustworthyAI/blob/master/gcastle/castle/algorithms/lingam/direct_lingam.py), but it seems it does not work in the current version (1.0.3).

I am referring to these (lines 76-77):

@check_args_value(DIRECT_LINGAM_VALID_PARAMS)
def __init__(self, prior_knowledge=None, measure='pwling', thresh=0.3):
   ...

I tried adding a priori knowledge to Direct LiNGAM and it did not work for me (the model was not adding the edges passed to prior_knowlede)

I think that actually it is possible to add the prior knowledge functionality for Direct LiNGAM (it was described in the paper if I'm not mistaken).

Perhaps that would be a good first step for enhancing the palette of models that accept prior knowledge.

What are your thoughts on this?

@shaido987
Copy link
Collaborator

Yes, I agree that making sure that it works for DirectLiNGAM would be a good first step forward.

For the a prior knowledge added to the PC implementation (added in #73) we added a PrioriKnowledge class that can be used here. I believe it should have the same characteristics as the input matrix in DirectLiNGAM.

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

3 participants