Model for Decision in PGM
- class pyagrum.InfluenceDiagram(*args)
InfluenceDiagram represents an Influence Diagram.
- InfluenceDiagram() -> InfluenceDiagram
default constructor
- InfluenceDiagram(source) -> InfluenceDiagram
- Parameters:
source (
pyagrum.InfluenceDiagram) – the InfluenceDiagram to copy
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 a variable, it’s associate node and it’s CPT. |
|
Add an arc in the ID, and update diagram’s tensor nodes cpt if necessary. |
|
add a list of arcs in te model. |
|
Add a chance variable, it’s associate node and it’s CPT. |
|
Add a decision variable. |
|
Add the listeners in parameters to the list of existing ones. |
|
Add a utility variable, it’s associate node and it’s UT. |
|
Add a list of variable in the form of ‘fast’ syntax. |
|
adjacency matrix from a graph/graphical models |
|
give the set of nodeid of ancestors of a node |
|
Begin a sequence of structural modifications to the influence diagram. |
|
give the set of nodeid of the children of a node (or of a set of nodes) |
|
Clear the influence diagram, removing all nodes and arcs. |
|
Give an instantiation over all the variables of the model |
|
Return the weakly connected components of the graph. |
|
number of connected components |
|
connected components as a dict of sets |
|
Returns the CPT of a variable. |
|
Return the sequence of decision nodes in a valid decision order. |
|
give the set of nodeid of descendants of a node |
|
Check if there are some variables in the model. |
|
End a sequence of structural modifications and recompute internal structures. |
|
Erase a Variable from the network and remove the variable from all his childs. |
|
Removes an arc in the ID, and update diagram’s tensor nodes cpt if necessary. |
|
Check if a node with this name or id exists |
|
Check if an arc exists |
|
Check whether a property key exists in the model’s metadata. |
|
give the set of parents of a node and the node |
|
Create an Influence Diagram with a dot-like syntax which specifies: |
|
Return the node id of a variable given its name. |
|
List of ids for a list of names of variables in the model |
|
The ids of nodes given by their names, in a container of the same type. |
|
check if nodes X and nodes Y are independent given nodes Z |
|
Load a BIFXML file. |
|
Load a jgum (JSON) or bgum (binary/msgpack) file. |
|
Deserialize an InfluenceDiagram from a jgum JSON string. |
|
returns the log10 of the domain size of the model defined as the product of the domain sizes of the variables in the model. |
|
Return a minimal conditioning set of a target node (or set of nodes) given a set of source nodes in the DAG model. |
|
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. |
|
build a UndiGraph by moralizing the Ancestral Graph of a list of nodes |
|
The names of nodes given by their ids, in a container of the same type. |
|
Return the node id of a variable. |
|
Set of ids for a list of names of variables in the model |
|
give the set of nodeid of the parents of a node (or of a set of nodes) |
|
Return the keys of all metadata properties of the model. |
|
Save the BayesNet in a BIFXML file. |
|
Save the influence diagram as a .jgum (text) or .bgum (binary) file. |
|
Save the influence diagram as a jgum string. |
|
Return a human-readable string summarising the space complexity of a graphical model. |
|
Export the influence diagram in fast syntax (the structure and the variables, not the parameters), read back by |
|
Update the model’s built-in metadata (version, creation date, last modification date). |
|
Return the variable with the given name. |
|
Return the variables of the model: all of them, or those corresponding to a list of names or to a set of node ids. |