CredalNet.nodeType
- CredalNet.nodeType(id)
- Parameters:
id (
int) – the id of the node- Returns:
the type of the node in the original network, one of
CredalNet.NodeType_Precise(a single distribution for each configuration of the parents),CredalNet.NodeType_Vacuous(the credal sets contain every distribution) andCredalNet.NodeType_Credal(any other credal set).- Return type:
int
Example
import pyagrum as gum
bn = gum.fastBN("A->B")
bnmin, bnmax = gum.BayesNet(bn), gum.BayesNet(bn)
bnmin.cpt("A").fillWith([0.2, 0.6])
bnmax.cpt("A").fillWith([0.4, 0.8])
bnmin.cpt("B")[:] = [[0.1, 0.7], [0.5, 0.3]]
bnmax.cpt("B")[:] = [[0.3, 0.9], [0.7, 0.5]]
cn = gum.CredalNet(bnmin, bnmax)
cn.intervalToCredal()
cn.nodeType(cn.src_bn().idFromName("A")) == gum.CredalNet.NodeType_Credal
# True
Class