NamedJunctionTree¶
- class otagrum.NamedJunctionTree(*args)¶
NamedJunctionTree interface.
- Available constructors:
NamedJunctionTree(jt, names)
NamedJunctionTree(jt, bn)
- Parameters:
- jt
pyagrum.CliqueGraph A junction tree.
- bn
pyagrum.BayesNet A bayesian network.
- nameslist
A list of node names.
- jt
Methods
getClique(nod)Return id of the variables in the clique.
Cliques accessor
Return the description of the named junction tree.
getMarginal(indices)Return the marginal junction tree on desired variables.
getNeighbours(id)Return the neighbours of a clique node.
getNodes()Return ids of the clique nodes in the junction tree.
Return an order on the junction tree beginning with the largest clique.
getSeparator(nod1, nod2)Return the separator associated to an edge of the junction tree.
Separators accessor
getSize()Return size of the named junction tree.
Examples
>>> import otagrum >>> import pyagrum as gum >>> bn = gum.BayesNet.fastPrototype('0->1->2->3;1->4->3;4->5;6->5;7->5') >>> ie = gum.LazyPropagation(bn) >>> jtagr = ie.junctionTree() >>> njt = otagrum.NamedJunctionTree(jtagr, bn)
- __init__(*args)¶
- getClique(nod)¶
Return id of the variables in the clique.
- Parameters:
- nodeint
Id of the desired node clique.
- Returns:
- clique
Indices Indices of the variables in the desired clique node.
- clique
- getCliquesCollection()¶
Cliques accessor
- Returns:
- cliquessequence of
openturns.Indices List of cliques
- cliquessequence of
- getDescription()¶
Return the description of the named junction tree.
- Returns:
- nameslist
The list of variable names.
- getMarginal(indices)¶
Return the marginal junction tree on desired variables.
- Parameters:
- nodes
Indices Ids of target variables.
- nodes
- Returns:
- marginal
NamedJunctionTree Marginal junction tree on target variables.
- marginal
- getNeighbours(id)¶
Return the neighbours of a clique node.
- Parameters:
- nodeint
Id of a clique node in the junction tree.
- Returns:
- neighbours
Indices Neighbours of the desired clique node.
- neighbours
- getNodes()¶
Return ids of the clique nodes in the junction tree.
- Returns:
- nodes
Indices Ids of the clique nodes
- nodes
- getOrderMaxFirst()¶
Return an order on the junction tree beginning with the largest clique.
- Returns:
- order
Indices The order.
- order
- getSeparator(nod1, nod2)¶
Return the separator associated to an edge of the junction tree.
- Parameters:
- node1int
Id of one end of the desired edge.
- node2int
Id of the other end of the desired edge.
- Returns:
- separator
Indices Separator associated to the desired edge.
- separator
- getSeparatorsCollection()¶
Separators accessor
- Returns:
- separatorssequence of
openturns.Indices List of separators
- separatorssequence of
- getSize()¶
Return size of the named junction tree.
- Returns:
- sizeint
The number of nodes in the junction tree.
otagrum