MarkovRandomField.changeVariableName

MarkovRandomField.changeVariableName(*args)

Changes a variable’s name in the pyagrum.MarkovRandomField.

This will change the pyagrum.DiscreteVariable names in the pyagrum.MarkovRandomField.

Parameters:
  • car (int | str) – a variable’s id (int) or name

  • new_name (str) – the new name of the variable

Raises:
Return type:

None

Example

import pyagrum as gum

mrf = gum.fastMRF("A--B;B--C")
mrf.changeVariableName("A", "Alpha")
sorted(mrf.names())
# ['Alpha', 'B', 'C']

Class

MarkovRandomField