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

[Draft]: Calculate local markov blanket against true graph for parted nodes that passed AD Test #1757

Draft
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

vbcwonderland
Copy link
Collaborator

WIP! Need to check with Joe on how to find a node in estimated graph's corresponding node in the true graph. I tried using node's name, but it doesnt seem to work from unit test result.

@vbcwonderland vbcwonderland marked this pull request as draft April 7, 2024 22:26
@@ -103,7 +103,7 @@ public static boolean isClique(Collection<Node> set, Graph graph) {
* @param graph a DAG, CPDAG, MAG, or PAG.
* @return a {@link edu.cmu.tetrad.graph.Graph} object
*/
public static Graph markovBlanketSubgraph(Node target, Graph graph) {
public static Graph markovBlanketSubgraph(Node target, Graph graph) { // TODO VBC: @Joe is this the more general method you recommended?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdramsey for confirmation :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the method I had in mind:

public Graph getMarkovBlanketSubgraph(Graph graph, Node targetNode) {
    EdgeListGraph g = new EdgeListGraph();
    Set<Node> nodes = GraphUtils.markovBlanket(targetNode, g);
    return g.subgraph(new ArrayList<>(nodes));
}

You could put that method somewhere helpful; it may not already exist in the code.


double precision = (double) truePositive.size() / xMBLookupGraphEdges.size();
double recall = (double) truePositive.size() / xMBEstimatedGraphEdges.size();
return getPrecision ? precision : recall;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These outprints seems correct to me, maybe you want a second check : )

System.out.println("@@@@@@@@@@@@@@@@");

HashSet<Edge> truePositive = new HashSet<>(xMBEstimatedGraphEdges);
// TODO VBC: QUESTION FOr DISCUSSION
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdramsey We need to discuss this tho

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 9, 2024

As for what exactly to report, I think I would myself need input from Peter here. What you're reporting sounds fine to me, but he may want something different...

@vbcwonderland vbcwonderland removed the request for review from jdramsey April 18, 2024 00:23
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

Successfully merging this pull request may close these issues.

2 participants