Click here to hide/show the list of notebooks.
  pyAgrum on notebooks   pyAgrum jupyter
☰  LazyPropagationAdvancedFeatures 
pyAgrum 0.16.3   
Zipped notebooks   
generation: 2019-10-20 09:16  

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
A
H
0
1
0
0
0.57900.4210
1
0.59450.4055
1
0
0.48330.5167
1
0.49930.5007

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
A
B
D
0
1
0
0
0
0.41150.5885
1
0.44520.5548
1
0
0.35480.6452
1
0.47640.5236
1
0
0
0.58640.4136
1
0.61940.3806
1
0
0.52730.4727
1
0.64850.3515
In [5]:
ie.evidenceImpact("E",["A","B","C","D","F"]) # {A,C,D} d-separates E and {B,F}
Out[5]:
E
C
A
D
0
1
0
0
0
0.05680.9432
1
0.55150.4485
1
0
0.10890.8911
1
0.71380.2862
1
0
0
0.55510.4449
1
0.26560.7344
1
0
0.71680.2832
1
0.42310.5769
In [6]:
ie.evidenceJointImpact(["A","F"],["B","C","D","E","H"]) # {B,E} d-separates [A,F] and [C,D,H]
Out[6]:
A
E
B
F
0
1
0
0
0
0.36570.0364
1
0.53450.0633
1
0
0.36530.0645
1
0.49460.0755
1
0
0
0.38520.0189
1
0.56300.0329
1
0
0.39330.0343
1
0.53240.0401
In [ ]: