MarkovRandomField.idFromName

MarkovRandomField.idFromName(name)

Return the node id of a variable given its name.

Parameters:

name (str) – the name of the variable

Returns:

the node id of the variable

Return type:

int

Raises:

pyagrum.NotFound – if no variable with this name exists in the model

Example

import pyagrum as gum

mrf = gum.fastMRF("A--B;B--C")
mrf.idFromName("C")
# 2

Class

MarkovRandomField