CausalModel.variable

CausalModel.variable(*args)

Return the variable with the given id or name (observed variables only).

Parameters:

id_or_name (int | str) – the node id or name of the variable

Returns:

the discrete variable

Return type:

pyagrum.DiscreteVariable

Raises:

Example

import pyagrum as gum

bn = gum.fastBN("A{yes|no}->B[3]")
cm = gum.CausalModel(bn)
print(cm.variable("A"))
# A:Labelized({yes|no})
cm.variable(cm.idFromName("B")).labels()
# ('0', '1', '2')

Class

CausalModel