NamedJunctionTree

class otagrum.NamedJunctionTree(*args)

NamedJunctionTree interface.

Available constructors:

NamedJunctionTree(jt, names)

NamedJunctionTree(jt, bn)

Parameters:
jtpyAgrum.CliqueGraph

A junction tree.

bnpyAgrum.BayesNet

A bayesian network.

nameslist

A list of node names.

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)

Methods

getClique(nod)

Return id of the variables in the clique.

getCliquesCollection()

Cliques accessor

getDescription()

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.

getOrderMaxFirst()

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.

getSeparatorsCollection()

Separators accessor

getSize()

Return size of the named junction tree.

__init__(*args)
getClique(nod)

Return id of the variables in the clique.

Parameters:
nodeint

Id of the desired node clique.

Returns:
cliqueIndices

Indices of the variables in the desired clique node.

getCliquesCollection()

Cliques accessor

Returns:
cliquessequence of openturns.Indices

List of cliques

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:
nodesIndices

Ids of target variables.

Returns:
marginalNamedJunctionTree

Marginal junction tree on target variables.

getNeighbours(id)

Return the neighbours of a clique node.

Parameters:
nodeint

Id of a clique node in the junction tree.

Returns:
neighboursIndices

Neighbours of the desired clique node.

getNodes()

Return ids of the clique nodes in the junction tree.

Returns:
nodesIndices

Ids of the clique nodes

getOrderMaxFirst()

Return an order on the junction tree beginning with the largest clique.

Returns:
orderIndices

The 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:
separatorIndices

Separator associated to the desired edge.

getSeparatorsCollection()

Separators accessor

Returns:
separatorssequence of openturns.Indices

List of separators

getSize()

Return size of the named junction tree.

Returns:
sizeint

The number of nodes in the junction tree.