Model for Decision in PGM

an influence diagram
class pyagrum.InfluenceDiagram(*args)

InfluenceDiagram represents an Influence Diagram.

InfluenceDiagram() -> InfluenceDiagram

default constructor

InfluenceDiagram(source) -> InfluenceDiagram
Parameters:

Scientific notes

An influence diagram [1] extends a Bayesian network with decision nodes and utility nodes to represent a decision problem. A chance node has a CPT given its parents; a decision node has no table, its parents being the information available when the decision is made; a utility node has no child, and its table gives a utility for each configuration of its parents (in pyAgrum, its variable has a single value). The utilities are additive: a strategy (a policy for each decision) is evaluated by the expected value of the sum of the utility nodes, and solving the diagram means finding a strategy that maximizes this expected utility.

In the classical definition, the decisions are totally ordered by a directed path (decisionOrder, decisionOrderExists) and a decision does not forget what was known at the previous ones (no-forgetting). The same structure also represents a LIMID (limited memory influence diagram) [2], without the no-forgetting assumption: a decision only knows its parents. Which assumption is made belongs to the inference engine, see pyagrum.ShaferShenoyLIMIDInference.

Methods

add()

Add a variable, it’s associate node and it’s CPT.

addArc()

Add an arc in the ID, and update diagram’s tensor nodes cpt if necessary.

addArcs()

add a list of arcs in te model.

addChanceNode()

Add a chance variable, it’s associate node and it’s CPT.

addDecisionNode()

Add a decision variable.

addStructureListener()

Add the listeners in parameters to the list of existing ones.

addUtilityNode()

Add a utility variable, it’s associate node and it’s UT.

addVariables()

Add a list of variable in the form of ‘fast’ syntax.

adjacencyMatrix()

adjacency matrix from a graph/graphical models

ancestors()

give the set of nodeid of ancestors of a node

arcs()

beginTopologyTransformation()

Begin a sequence of structural modifications to the influence diagram.

chanceNodeSize()

changeVariableName()

children()

give the set of nodeid of the children of a node (or of a set of nodes)

clear()

Clear the influence diagram, removing all nodes and arcs.

completeInstantiation()

Give an instantiation over all the variables of the model

connectedComponents()

Return the weakly connected components of the graph.

connectedComponentsCount()

number of connected components

connectedComponentsList()

connected components as a dict of sets

cpt()

Returns the CPT of a variable.

dag()

decisionNodeSize()

decisionOrder()

Return the sequence of decision nodes in a valid decision order.

decisionOrderExists()

descendants()

give the set of nodeid of descendants of a node

empty()

Check if there are some variables in the model.

endTopologyTransformation()

End a sequence of structural modifications and recompute internal structures.

erase()

Erase a Variable from the network and remove the variable from all his childs.

eraseArc()

Removes an arc in the ID, and update diagram’s tensor nodes cpt if necessary.

exists()

Check if a node with this name or id exists

existsArc()

Check if an arc exists

existsPathBetween()

existsProperty()

Check whether a property key exists in the model’s metadata.

family()

give the set of parents of a node and the node

fastPrototype()

Create an Influence Diagram with a dot-like syntax which specifies:

getDecisionGraph()

hasSameStructure()

idFromName()

Return the node id of a variable given its name.

ids()

List of ids for a list of names of variables in the model

idsFromNames()

The ids of nodes given by their names, in a container of the same type.

isChanceNode()

isDecisionNode()

isIndependent()

check if nodes X and nodes Y are independent given nodes Z

isUtilityNode()

loadBIFXML()

Load a BIFXML file.

loadGUM()

Load a jgum (JSON) or bgum (binary/msgpack) file.

loadGUMstring()

Deserialize an InfluenceDiagram from a jgum JSON string.

log10DomainSize()

returns the log10 of the domain size of the model defined as the product of the domain sizes of the variables in the model.

minimalCondSet()

Return a minimal conditioning set of a target node (or set of nodes) given a set of source nodes in the DAG model.

moralGraph()

Returns the moral graph of the BayesNet, formed by adding edges between all pairs of nodes that have a common child, and then making all edges in the graph undirected.

moralizedAncestralGraph()

build a UndiGraph by moralizing the Ancestral Graph of a list of nodes

names()

namesFromIds()

The names of nodes given by their ids, in a container of the same type.

nodeId()

Return the node id of a variable.

nodes()

nodeset()

Set of ids for a list of names of variables in the model

parents()

give the set of nodeid of the parents of a node (or of a set of nodes)

properties()

Return the keys of all metadata properties of the model.

saveBIFXML()

Save the BayesNet in a BIFXML file.

saveGUM()

Save the influence diagram as a .jgum (text) or .bgum (binary) file.

saveGUMstring()

Save the influence diagram as a jgum string.

size()

sizeArcs()

spaceCplxToString()

Return a human-readable string summarising the space complexity of a graphical model.

toDot()

toFast()

Export the influence diagram in fast syntax (the structure and the variables, not the parameters), read back by pyagrum.fastID.

topologicalOrder()

updateMetaData()

Update the model’s built-in metadata (version, creation date, last modification date).

utility()

utilityNodeSize()

variable()

variableFromName()

Return the variable with the given name.

variables()

Return the variables of the model: all of them, or those corresponding to a list of names or to a set of node ids.