Click here to hide/show the list of notebooks.
  pyAgrum on notebooks   pyAgrum jupyter
☰  LazyPropagationAdvancedFeatures 
pyAgrum 0.15.2   
Zipped notebooks   
generation: 2019-07-22 10:34  

Creative Commons License
This pyAgrum's notebook is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

In [1]:
import pyAgrum as gum
import pyAgrum.lib.notebook as gnb
In [2]:
bn=gum.fastBN("A->B->C->D;A->E->D;F->B;C->H")
ie=gum.LazyPropagation(bn)
bn              
Out[2]:
G A A B B A->B E E A->E C C B->C D D C->D H H C->H E->D F F F->B

Evidence Impact allows the user to analyze the effect of any variables on any other variables

In [3]:
ie.evidenceImpact("B",["A","H"])
Out[3]:
B
H
A
0
1
0
0
0.81620.1838
1
0.77930.2207
0
1
0.90220.0978
1
0.88000.1200

Evidence impact is able to find the minimum set of variables which effectively conditions the analyzed variable

In [4]:
ie.evidenceImpact("E",["A","F","B","D"]) # {A,D,B} d-separates E and F
Out[4]:
E
D
B
A
0
1
0
0
0
0.37340.6266
1
0.21590.7841
0
1
0.49120.5088
1
0.17450.8255
0
0
1
0.51970.4803
1
0.33330.6667
0
1
0.63680.3632
1
0.27740.7226
In [5]:
ie.evidenceImpact("E",["A","B","C","D","F"]) # {A,C,D} d-separates E and {B,F}
Out[5]:
E
D
A
C
0
1
0
0
0
0.90670.0933
1
0.11560.8844
0
1
0.94640.0536
1
0.19190.8081
0
0
1
0.14950.8505
1
0.48810.5119
0
1
0.24200.7580
1
0.63390.3661
In [6]:
ie.evidenceJointImpact(["A","F"],["B","C","D","E","H"]) # {B,E} d-separates [A,F] and [C,D,H]
Out[6]:
A
F
B
E
0
1
0
0
0
0.00040.0576
1
0.01170.9303
0
1
0.01200.6367
1
0.01280.3385
0
0
1
0.00070.0570
1
0.02110.9212
0
1
0.02140.6240
1
0.02280.3318
In [ ]: