MarkovRandomField.changeVariableName
- MarkovRandomField.changeVariableName(*args)
Changes a variable’s name in the
pyagrum.MarkovRandomField.This will change the
pyagrum.DiscreteVariablenames in thepyagrum.MarkovRandomField.- Parameters:
car (
int | str) – a variable’s id (int) or namenew_name (
str) – the new name of the variable
- Raises:
pyagrum.DuplicateLabel – If new_name is already used in this MarkovRandomField.
pyagrum.NotFound – If no variable matches id.
- 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