Discrete Bayesian networks

<< Click to Display Table of Contents >>

Navigation:  Using SMILE >

Discrete Bayesian networks

Discrete Bayesian networks contain variables (nodes). A node describes a finite set of conditions and takes values from a finite, usually small, set of states (outcomes). The DSL_nodeDef and DSL_nodeVal APIs were designed to cover all functionality required to work with discrete variables with outcomes described by string labels (identifiers). In SMILE 2, we introduced an option to use numeric domains with discrete nodes.

Regardless of the domain of a node, its outcomes can be managed with DSL_nodeDef::SetNumberOfOutcomes, AddOutcome, InsertOutcome and DeleteOutcome. Access to outcomes is available through DSL_nodeDef::GetNumberOfOutcomes and GetOutcomeIds.

Evidence for discrete nodes can be set and read with DSL_nodeVal::SetEvidence(int) and DSL_nodeVal::GetEvidence. After successful inference DSL_nodeVal::GetMatrix will return a pointer to an one-dimensional matrix containing the calculated posterior marginal probabilities for the node.