ImportanceSampling.addTarget

ImportanceSampling.addTarget(*args)

Add a marginal target to the list of targets.

Parameters:
  • target (int) – a node Id

  • nodeName (str) – a node name

Raises:

pyagrum.UndefinedElement – If target is not a NodeId in the Bayes net

Return type:

None

Example

import pyagrum as gum

bn = gum.fastBN("A->B<-C")
ie = gum.ImportanceSampling(bn)
ie.addTarget("B")
ie.addTarget("C")
sorted(ie.targets())
# [1, 2]

Class

ImportanceSampling

Overridden in

LoopyImportanceSampling.addTarget