BayesNet.variable
- BayesNet.variable(*args)
- Parameters:
id (
int) – a variable’s idname (
str) – a variable’s name
- Returns:
the variable
- Return type:
- Raises:
pyagrum.NotFound – If the graph does not contain the variable
Example
import pyagrum as gum
bn = gum.fastBN("A->B{yes|no|maybe}")
print(bn.variable("B"))
# B:Labelized({yes|no|maybe})
bn.variable(0).name()
# 'A'
Class