GibbsSampling.setTargets
- GibbsSampling.setTargets(targets)
Remove all the targets and add the ones in parameter. Every target is checked first: a refused call keeps the former targets.
- Parameters:
targets (
Iterable[int | str]) – the ids or names of the targets- Raises:
TypeError – If targets is a single name or id instead of an iterable.
pyagrum.NotFound – If a name is not the name of a node of the model.
pyagrum.UndefinedElement – If an id is not the id of a node of the model.
- Return type:
None
Example
import pyagrum as gum
bn = gum.fastBN("A->B<-C")
ie = gum.GibbsSampling(bn)
ie.setTargets({"A", "C"})
sorted(ie.targets())
# [0, 2]
Class
Overridden in