BayesNet.changeVariableLabel

BayesNet.changeVariableLabel(*args)

change the label of the variable associated to nodeId to the new value.

Parameters:
  • var (int | str) – the current name or the id of the variable

  • old_label (str) – the new label

  • new_label (str) – the new label

Raises:

pyagrum.NotFound – if id/name is not a variable or if old_label does not exist.

Return type:

None

Example

import pyagrum as gum

bn = gum.fastBN("A{yes|no}->B")
bn.changeVariableLabel("A", "yes", "oui")
bn.variable("A").labels()
# ('oui', 'no')

Class

BayesNet