Lazy Propagation uses a secondary structure called the “Junction Tree” to perform the inference.
import pyagrum.lib.notebook as gnb
bn = gum.loadBN("res/alarm.dsl")
gnb.showJunctionTreeMap(bn);

But this junction tree can be transformed to build different probabilistic queries.
bn = gum.fastBN("A->B->C->D;A->E->D;F->B;C->H")
ie = gum.LazyPropagation(bn)
Evidence Impact allows the user to analyze the effect of any variables on any other variables
ie.evidenceImpact("B", ["A", "H"])
|
B
|
| A | H |
0 |
1 |
|
0 | 0 | 0.0841 | 0.9159 |
| 1 | 0.1104 | 0.8896 |
|
1 | 0 | 0.5675 | 0.4325 |
| 1 | 0.6396 | 0.3604 |
Evidence impact is able to find the minimum set of variables which effectively conditions the analyzed variable
ie.evidenceImpact("E", ["A", "F", "B", "D"]) # {A,D,B} d-separates E and F
|
E
|
| A | B | D |
0 |
1 |
|
0 |
0 | 0 | 0.5582 | 0.4418 |
| 1 | 0.2303 | 0.7697 |
|
1 | 0 | 0.5830 | 0.4170 |
| 1 | 0.1880 | 0.8120 |
|
1 |
0 | 0 | 0.8034 | 0.1966 |
| 1 | 0.4918 | 0.5082 |
|
1 | 0 | 0.8189 | 0.1811 |
| 1 | 0.4282 | 0.5718 |
ie.evidenceImpact("E", ["A", "B", "C", "D", "F"]) # {A,C,D} d-separates E and {B,F}
|
E
|
| C | A | D |
0 |
1 |
|
0 |
0 | 0 | 0.6455 | 0.3545 |
| 1 | 0.0600 | 0.9400 |
|
1 | 0 | 0.8548 | 0.1452 |
| 1 | 0.1711 | 0.8289 |
|
1 |
0 | 0 | 0.4814 | 0.5186 |
| 1 | 0.3389 | 0.6611 |
|
1 | 0 | 0.7502 | 0.2498 |
| 1 | 0.6238 | 0.3762 |
ie.evidenceJointImpact(["A", "F"], ["B", "C", "D", "E", "H"]) # {B,E} d-separates [A,F] and [C,D,H]
|
A
|
| E | B | F |
0 |
1 |
|
0 |
0 | 0 | 0.0974 | 0.7268 |
| 1 | 0.1018 | 0.0740 |
|
1 | 0 | 0.7291 | 0.1911 |
| 1 | 0.0514 | 0.0283 |
|
1 |
0 | 0 | 0.2180 | 0.5029 |
| 1 | 0.2279 | 0.0512 |
|
1 | 0 | 0.8594 | 0.0696 |
| 1 | 0.0606 | 0.0103 |