MonteCarloSampling.evidenceImpact
- MonteCarloSampling.evidenceImpact(target, evs)
Create a
pyagrum.Tensorfor P(target|evs) (for all instanciation of target and evs)- Parameters:
target (
int | str) – the id or the name of the targetevs (
set[int | str] | list[int | str]) – the ids or names of the nodes of evidence
Warning
if some evs are d-separated, they are not included in the Tensor.
- Returns:
a Tensor for P(targets|evs)
- Return type:
Example
import pyagrum as gum
bn = gum.fastBN("A->B<-C", uniform=True)
ie = gum.MonteCarloSampling(bn)
p = ie.evidenceImpact("B", ["A", "C"]) # P(B|A,C)
p.names, p.shape
# (('B', 'A', 'C'), (2, 2, 2))
Class
Overridden in