Show all expected utilities and how to plot a influence diagram with charts.
Hi I'm a student and We are doing a project using Bayesian Network, I found your library very useful!. We are working on using influence diagrams for decision making. I have two questions:
- There's a way to obtain all the expected utilities for each decision? like a dictionary or something. I know there exists a function that selects the max of the expected utility, even I could obtain the table utility, but I don't know how to obtain using the table the expected utility of all decision options.
- ¿ Is there a way I could plot an influence diagram like this ?, I know you guys have already the representation from the chance nodes!
This is the simple example we are working for the moment:
diag=gum.InfluenceDiagram()
F=diag.addChanceNode(gum.LabelizedVariable("Stock","Prob Stock",2))
D=diag.addDecisionNode(gum.LabelizedVariable("Decision","Invest",2))
U=diag.addUtilityNode(gum.LabelizedVariable("Utility","Expected Utility",1))
#Unir nodos
diag.addArc(D,U)
diag.addArc(F,U)
diag
diag.cpt(F)[{'Decision':0}]=[1,0]
diag.cpt(F)[{'Decision':1}]=[0.6,0.4]
diag.utility(U)[{'Stock':0,'Decision':1}]=1100
diag.utility(U)[{'Stock':1,'Decision':1}]=900
diag.utility(U)[{'Stock':0,'Decision':0}]=1000
diag.utility(U)[{'Stock':1,'Decision':0}]=1000
ie=gum.InfluenceDiagramInference(diag)
table = diag.utility("Utility")
print("Best decision to invest or not : {0}".format(ie.getBestDecisionChoice(diag.idFromName("Decision"))))
print("For a maxEU : {0}".format(ie.getMEU()))
Let me know what I can do to solve this problem, and I will try to do it!
Thanks,
Edited by Migu Gut