Package weka.classifiers.bayes.net
Class MarginCalculator
java.lang.Object
weka.classifiers.bayes.net.MarginCalculator
- All Implemented Interfaces:
Serializable,RevisionHandler
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcalcFullMargins(BayesNet bayesNet) voidcalcMargins(BayesNet bayesNet) Calc marginal distributions of nodes in Bayesian network Note that a connected network is assumed.boolean[][]fillIn(int[] order, boolean[][] bAdjacencyMatrix) Apply Tarjan and Yannakakis (1984) fill in algorithm for graph triangulation.double[]getMargin(int iNode) intReturns the revision string.static voidboolean[][]moralize DAG and calculate adjacency matrix representation for a Bayes Network, effecively converting the directed acyclic graph to an undirected graph.voidvoidsetEvidence(int nNode, int iValue) toString()
-
Field Details
-
m_root
-
-
Constructor Details
-
MarginCalculator
public MarginCalculator()
-
-
Method Details
-
getNode
-
toXMLBIF03
-
calcMargins
Calc marginal distributions of nodes in Bayesian network Note that a connected network is assumed. Unconnected networks may give unexpected results.- Parameters:
bayesNet-- Throws:
Exception
-
calcFullMargins
- Throws:
Exception
-
process
- Throws:
Exception
-
moralize
moralize DAG and calculate adjacency matrix representation for a Bayes Network, effecively converting the directed acyclic graph to an undirected graph.- Parameters:
bayesNet- Bayes Network to process- Returns:
- adjacencies in boolean matrix format
-
fillIn
public boolean[][] fillIn(int[] order, boolean[][] bAdjacencyMatrix) Apply Tarjan and Yannakakis (1984) fill in algorithm for graph triangulation. In reverse order, insert edges between any non-adjacent neighbors that are lower numbered in the ordering. Side effect: input matrix is used as output- Parameters:
order- node orderingbAdjacencyMatrix- boolean matrix representing the graph- Returns:
- boolean matrix representing the graph with fill ins
-
setEvidence
- Throws:
Exception
-
toString
-
getMargin
public double[] getMargin(int iNode) -
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
main
-