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

MarkovCheck renaming to checkIndependenceForTargetNode #1794

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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