Click here to hide/show the list of notebooks.
  pyAgrum on notebooks   pyAgrum jupyter
☰  o3prm 
pyAgrum 0.15.1   
Zipped notebooks   
generation: 2019-06-16 19:06  

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

In [1]:
import os
os.chdir("res")

import pyAgrum as gum
import pyAgrum.lib.notebook as gnb

Using o3prm syntax for creating BayesNet

In [2]:
bn=gum.loadBN("./Asia.o3prm",verbose=False)
bn
Out[2]:
G visitToAsia visitToAsia tuberculosis tuberculosis visitToAsia->tuberculosis tubOrCancer tubOrCancer tuberculosis->tubOrCancer smoking smoking lungCancer lungCancer smoking->lungCancer bronchitis bronchitis smoking->bronchitis lungCancer->tubOrCancer dyspnea dyspnea bronchitis->dyspnea positiveXRay positiveXRay tubOrCancer->positiveXRay tubOrCancer->dyspnea
In [3]:
bn=gum.loadBN("./aSys.o3prm")
bn
Out[3]:
G A1.Productivity A1.Productivity A1.Cost A1.Cost A1.Productivity->A1.Cost A2.Agg_Productivity A2.Agg_Productivity A1.Productivity->A2.Agg_Productivity A1.Capacity A1.Capacity A1.Capacity->A1.Cost A0.Productivity A0.Productivity A0.Cost A0.Cost A0.Productivity->A0.Cost A0.Productivity->A2.Agg_Productivity A0.Capacity A0.Capacity A0.Capacity->A0.Cost A2.Productivity A2.Productivity A2.Cost A2.Cost A2.Productivity->A2.Cost A2.Capacity A2.Capacity A2.Capacity->A2.Cost A2.Agg_Productivity->A2.Productivity
In [4]:
classpath="./ComplexPrinters"  
filename="./ComplexPrinters/fr/lip6/printers/system.o3prm"

system="Work"
bn=gum.loadBN(filename,system=system,classpath=classpath)
#gnb.showBN(bn,size='10',format="svg")
gnb.showInference(bn,size="150",format='png')