Class GraphSampling
Jan 29, 2023 3:28:26 PM
- Version:
- $Id: $Id
- Author:
- Kevin V. Bui (kvb2univpitt@gmail.com)
-
Method Summary
Modifier and TypeMethodDescriptionstatic GraphcreateDisplayGraph(Graph graph, ResamplingEdgeEnsemble ensemble) Create a graph for displaying and print out.static GraphcreateGraphWithHighProbabilityEdges(List<Graph> graphs) Combine all the edges from the list of graphs onto one graph with the edge type that has the highest frequency probability.static GraphcreateGraphWithoutNullEdges(Graph graph) Create a graph from the given graph that contains no null edges.static EdgeTypeProbability.EdgeTypegetReversed(EdgeTypeProbability.EdgeType edgeType) Returns the reversed counterpart of the specified edge type.static GraphselectMedianEnsembleGraph(List<Graph> graphs) Selects, from among the given member graphs (the actual outputs of the bootstrap searches), the single graph whose edges best agree with the ensemble edge-type frequencies, and returns a copy of it annotated with those frequencies.
-
Method Details
-
createGraphWithoutNullEdges
-
createDisplayGraph
Create a graph for displaying and print out.- Parameters:
graph- aGraphobjectensemble- aResamplingEdgeEnsembleobject- Returns:
- a
Graphobject
-
createGraphWithHighProbabilityEdges
Combine all the edges from the list of graphs onto one graph with the edge type that has the highest frequency probability.- Parameters:
graphs- list of graphs- Returns:
- graph containing edges with edge type of the highest probability
-
selectMedianEnsembleGraph
Selects, from among the given member graphs (the actual outputs of the bootstrap searches), the single graph whose edges best agree with the ensemble edge-type frequencies, and returns a copy of it annotated with those frequencies.Motivation (2026-8-13):
createGraphWithHighProbabilityEdges(List)assembles per-pair majority edges drawn from DIFFERENT member graphs into a composite. Taken together those edges in general belong to no output equivalence class: the composite of legal PAGs or CPDAGs is typically not itself a legal PAG or CPDAG, which misleads users and breaks downstream operations that assume legality. The graph returned here IS one of the member graphs, so it inherits whatever legality guarantee the underlying algorithm provides.It is a median in the following sense: it maximizes, over member graphs G, the sum across node pairs of the ensemble frequency of G's own edge state on that pair (where "no edge" is a state like any other) - equivalently, it minimizes the total frequency-weighted disagreement with the ensemble. Ties are broken by the first maximizer in the given list order, so the result is deterministic for a fixed list of graphs. Each edge of the returned copy carries the full list of ensemble edge-type probabilities for its node pair, exactly as composite edges do, so frequency display in the interface works unchanged.
- Parameters:
graphs- the member graphs produced by the individual bootstrap searches- Returns:
- an annotated copy of the member graph closest to the ensemble frequencies
-
getReversed
Returns the reversed counterpart of the specified edge type. The reversal mapping is defined as follows: - EdgeType.ac is reversed to EdgeType.ca - EdgeType.at is reversed to EdgeType.ta - EdgeType.ca is reversed to EdgeType.ac - EdgeType.ta is reversed to EdgeType.at For any other edge type, the method returns the input edge type unchanged.- Parameters:
edgeType- the edge type to be reversed- Returns:
- the reversed edge type, or the input edge type if no reversal is defined
-