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

checking bayes nets: arrows go from relational attributes to rnodes, not the other way #81

Open
oschulte opened this issue Aug 22, 2018 · 8 comments
Assignees

Comments

@oschulte
Copy link
Collaborator

No description provided.

@oschulte
Copy link
Collaborator Author

Examples 👍

  • BIF_MovieLens_std
  • in unielwin, given RA = T, Capability should be n/a with almost probability 1

@woodsouths
Copy link
Contributor

the old xml file of toyexample
old_xml
and the new xml file of toyexample
new_xml
the new version misses a edge from RA to Salary. @oschulte

@oschulte
Copy link
Collaborator Author

Thanks runnan. This is because we are currently failing to add these edges by hand (from Rnodes to 2Nodes). Need to check why that part of the SQL script is not being called. Otherwise the edges are the same which is reassuring.

@oschulte
Copy link
Collaborator Author

@woodsouths @rmar3a So the problem seems to be that in model-manager.sql to build the SchemaEdges table, we need to refer to lattice_membership.member, not rnid. I hope this will fix Runnan's issue. As for the general logic, here's the behaviour I think we need.

  1. If link analysis is off, then insert the Schema_Edges pairs into Path_Bayes_Nets for the final result after structure learning and before parameter learning. The reason is that in this case, the Bayes net contains no rnodes during learning. This is similar to the current query except we insert into Required_Edges not Path_Bayes_Nets. We can check the Java code for this case.

  2. If link analysis is on, then insert the Schema_Edges pairs into Path_Required_Edges before learning. This will make them available for learning. Again We can check the Java code for this case.

@rmar3a
Copy link
Contributor

rmar3a commented Aug 29, 2018

So I did a bit of investigating to see how/why we dropped the values in the rnid column and it happened/is explained in this commit:

https://github.com/sfu-cl-lab/FactorBase/commit/dfe5e8ca821b1d092b487be1f696316099fd3e11

Also this issue is related to this pull request I made before:

https://github.com/sfu-cl-lab/FactorBase/pull/68

I will attempt to fix both of this issues in a future pull request.

@oschulte
Copy link
Collaborator Author

Sounds good. I think we can resolve this in 15 min. At least for the schema edges.

rmar3a added a commit that referenced this issue Aug 31, 2018
- Removed the "rnid" column from the lattice_membership table and
  made all references to that column use the "member" column instead.
  This is safe to do now because the values in the "member" column
  are using the full RNID instead of the short RNID.
- This should fix the issue where some arrows are missing in the Bayes
  Net that gets generated by FactorBase.

GitHub Issue: #81
@oschulte
Copy link
Collaborator Author

So if link analysis is off, schema edges should be added after structure learning and before parameter learning.

@woodsouths
Copy link
Contributor

Eliminate where clause from the creating the schemaEdges table

When link analysis is on:

  • Insert edges from schemaEdges into Path_Required_Edges before structure learning;

When link analysis is off:

  • Insert edges from schemaEdges into Path_BayesNets after structure learning (together with Progagate ContextEdges);

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