|
<< Click to Display Table of Contents >> Navigation: Using SMILE Wrappers > Networks, nodes and arcs > Nodes > Node value |
The value of a node contains the results calculated by the inference algorithm, typically the marginal probability distribution or expected utilities. Unlike the node definition, the node value is transient and is not stored as part of the network during I/O operations. Each node value also includes a validity flag, which is set to true by the inference algorithm once the calculations for the node have been successfully completed. Value-reading methods should only be called when this flag indicates that the value is valid.
In influence diagrams, the node value is computed for multiple sets of decisions. To correctly interpret these results, you need to retrieve the indexing parents of the node value. These indexing parents may or may not coincide with the node’s structural parents. For more details, refer to Influence diagrams section. When indexing parents are present, the values are organized as flattened vectors representing multidimensional arrays. For details on interpreting these arrays and converting between linear and multidimensional forms, see the Multidimensional arrays section.
Additional considerations apply in two cases:
•For dynamic Bayesian networks, the handling of node values is explained in the Temporal beliefs section.
•For equation nodes, the interpretation of the value differs from standard chance or utility nodes; see the Equation-based nodes section for details.
The following methods allow you to check the validity of a node value, retrieve the value itself, and obtain information about its indexing parents (if present):
Python
is_value_valid(node: int | str) -> bool
get_node_value(node: int | str) -> List[float]
get_value_indexing_parents(node: int | str) -> List[int]
get_value_indexing_parent_ids(node: int | str) -> List[str]
Java
boolean isValueValid(int nodeHandle);
boolean isValueValid(String nodeId);
double[] getNodeValue(int nodeHandle);
double[] getNodeValue(String nodeId);
int[] getValueIndexingParents(int nodeHandle);
int[] getValueIndexingParents(String nodeId);
String[] getValueIndexingParentIds(int nodeHandle);
String[] getValueIndexingParentIds(String nodeId);
C#
boolean IsValueValid(int nodeHandle);
boolean IsValueValid(String nodeId);
double[] GetNodeValue(int nodeHandle);
double[] GetNodeValue(String nodeId);
int[] GetValueIndexingParents(int nodeHandle);
int[] GetValueIndexingParents(string nodeId);
string[] GetValueIndexingParentIds(int nodeHandle);
string[] GetValueIndexingParentIds(string nodeId);
R
valid <- isValueValid(nodeIdOrHandle)
nodeValue <- getNodeValue(nodeIdOrHandle)
indexingParents <- get_value_indexing_parents(nodeIdOrHandle)
indexingParentIds <- get_value_indexing_parent_ids(nodeIdOrHandle)