MarkovRandomField.smallestFactorFromNode
- MarkovRandomField.smallestFactorFromNode(node)
Return the id set of the smallest factor that contains the given node.
- Parameters:
node (
int) – the node id- Returns:
the id set of the smallest factor containing this node
- Return type:
set[int]- Raises:
pyagrum.NotFound – if no factor contains this node
Example
import pyagrum as gum
mrf = gum.fastMRF("A--B--C;C--D")
mrf.smallestFactorFromNode(mrf.idFromName("C"))
# {2, 3}
Class