Lazy Propagation uses a secondary structure called the "Junction Tree" to perform the inference.
import pyAgrum as gum
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)
bn
Evidence Impact allows the user to analyze the effect of any variables on any other variables
ie.evidenceImpact("B",["A","H"])
|
| ||
---|---|---|---|
| 0.5808 | 0.4192 | |
0.6330 | 0.3670 | ||
| 0.4774 | 0.5226 | |
0.5321 | 0.4679 |
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
|
| |||
---|---|---|---|---|
|
| 0.4122 | 0.5878 | |
0.5387 | 0.4613 | |||
| 0.4061 | 0.5939 | ||
0.5414 | 0.4586 | |||
|
| 0.6919 | 0.3081 | |
0.7890 | 0.2110 | |||
| 0.6864 | 0.3136 | ||
0.7907 | 0.2093 |
ie.evidenceImpact("E",["A","B","C","D","F"]) # {A,C,D} d-separates E and {B,F}
|
| |||
---|---|---|---|---|
|
| 0.4307 | 0.5693 | |
0.5311 | 0.4689 | |||
| 0.7078 | 0.2922 | ||
0.7838 | 0.2162 | |||
|
| 0.3886 | 0.6114 | |
0.5493 | 0.4507 | |||
| 0.6705 | 0.3295 | ||
0.7960 | 0.2040 |
ie.evidenceJointImpact(["A","F"],["B","C","D","E","H"]) # {B,E} d-separates [A,F] and [C,D,H]
|
| |||
---|---|---|---|---|
|
| 0.3424 | 0.1607 | |
0.2966 | 0.2003 | |||
| 0.2197 | 0.2418 | ||
0.3189 | 0.2195 | |||
|
| 0.4554 | 0.0668 | |
0.3946 | 0.0832 | |||
| 0.3219 | 0.1107 | ||
0.4670 | 0.1004 |