Skip to content

Commit

Permalink
Merge pull request #1794 from cmu-phil/vbc-07-09-3
Browse files Browse the repository at this point in the history
MarkovCheck renaming to checkIndependenceForTargetNode
  • Loading branch information
jdramsey authored Jul 10, 2024
2 parents decf2f6 + a1e5a34 commit fdc7b5e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public AllSubsetsIndependenceFacts getAllSubsetsIndependenceFacts() {
* @param x The node for which to retrieve the local independence facts.
* @return The list of local independence facts for the given node.
*/
public List<IndependenceFact> getLocalIndependenceFacts(Node x) {
public List<IndependenceFact> checkIndependenceForTargetNode(Node x) {
Set<Node> parents = new HashSet<>(graph.getParents(x));

// Remove all parent nodes and x node itself from the graph
Expand Down Expand Up @@ -330,7 +330,7 @@ public List<List<Node>> getAndersonDarlingTestAcceptsRejectsNodesForAllNodes(Ind
List<Node> rejects = new ArrayList<>();
List<Node> allNodes = graph.getNodes();
for (Node x : allNodes) {
List<IndependenceFact> localIndependenceFacts = getLocalIndependenceFacts(x);
List<IndependenceFact> localIndependenceFacts = checkIndependenceForTargetNode(x);
// All local nodes' p-values for node x
List<List<Double>> shuffledlocalPValues = getLocalPValues(independenceTest, localIndependenceFacts, shuffleThreshold);
// TODO VBC: what should we do for cases when ADTest is NaN and ∞ ?
Expand Down Expand Up @@ -401,7 +401,7 @@ public List<List<Node>> getAndersonDarlingTestAcceptsRejectsNodesForAllNodesPlot
// Classify nodes into accepts and rejects base on ADTest result, and update confusion stats lists accordingly.
for (Node x : allNodes) {
System.out.println("Target Node: " + x);
List<IndependenceFact> localIndependenceFacts = getLocalIndependenceFacts(x);
List<IndependenceFact> localIndependenceFacts = checkIndependenceForTargetNode(x);
List<Double> ap_ar_ahp_ahr = getPrecisionAndRecallOnMarkovBlanketGraphPlotData(x, estimatedCpdag, trueGraph);
Double ap = ap_ar_ahp_ahr.get(0);
Double ar = ap_ar_ahp_ahr.get(1);
Expand Down Expand Up @@ -572,7 +572,7 @@ public List<List<Node>> getAndersonDarlingTestAcceptsRejectsNodesForAllNodesPlot
// Classify nodes into accepts and rejects base on ADTest result, and update confusion stats lists accordingly.
for (Node x : allNodes) {
System.out.println("Target Node: " + x);
List<IndependenceFact> localIndependenceFacts = getLocalIndependenceFacts(x);
List<IndependenceFact> localIndependenceFacts = checkIndependenceForTargetNode(x);
List<Double> lgp_lgr = getPrecisionAndRecallOnMarkovBlanketGraphPlotData2(x, estimatedCpdag, trueGraph);
Double lgp = lgp_lgr.get(0);
Double lgr = lgp_lgr.get(1);
Expand Down

0 comments on commit fdc7b5e

Please sign in to comment.