API Documentation - lhope/cl-bayesnet GitHub Wiki

API for package: cl-bayesnet
A Common Lisp Bayesian Network Inference Engine
-Functions
add-evidence object evidence standard-generic-function
Sets the evidence in a node via state index or symbol. For a net
or join-tree, adds the evidence as a plist of node-state pairs.
clear-evidence object standard-generic-function
Clear all evidence from object.
evidence object standard-generic-function
Returns the evidence in a node as its state symbol (nil if no
evidence), and for nets and join-trees a plist of node-state
pairs. Settable.
(setf evidence) evidence object standard-generic-function
Sets the evidence in a node via state index or symbol. For a net
or join-tree, sets the evidence as either a plist of node-state pairs,
or a vector of state indices (or -1 for unobserved) corresponding to
the net's node-order.
evidence-index object standard-generic-function
Returns the evidence in a node as a state index and nets as a
vector of state indices. -1 indicates no evidence.
load-ace file function
Load a file in ace file format. Returns a net.
load-dne file function
Load a file in Netica's dne file format. Returns a net.
load-xmlbif file function
Load a file in xmlbif file format. Returns a net.
name net/node standard-generic-function
For a net, a string identifier and for a node, a keyword
identifier.
net node/join-tree standard-generic-function
Returns the containing net for a node or join-tree.
node name/index net/join-tree standard-generic-function
Retrieve the node represented by a keyword name or index from the
given net or join-tree.
node-order net standard-generic-function
Returns a list of node-names as keywords. The ordering matches
their index order. This is set as part of the network compilation
process.
num-nodes net standard-generic-function
The amount of nodes in the network.
num-states node standard-generic-function
The amount of states for the given node.
parents node standard-generic-function
A vector of parent names as keywords for the given node.
query object &optional query function
Queries a net or node object.

node only - A probability vector for the states of node.

node and integer - The probability the node is in that numbered state (according to (states node)).

node and symbol - The probability the node is in that state.

node and list - A probability vector for the states of node given list, which is a plist of node-state pairs.

net only - The joint probability for the whole net.

net and vector - The joint probability for the whole net, given the vector. Vector has the num-nodes length, and contains either a state number for each node, or -1 if the node state is unknown.

net and symbol - A probability vector for the states of the node designated by symbol.

net and list - The joint probability for the whole net, given list, which is a plist of node-state pairs.

states node standard-generic-function
A vector of state names as keywords for the given node.
use-compiled-c net &optional source-location function
Writes out arithmetic circuit instructions to a c file, compiles it
with gcc, loads the shared object, and prepares the net to use the
loaded function. If source-location is specified, writes the c file
there. Otherwise uses a temporary file.

Returns the closure used, the raw cffi function pointer, and the number of instructions.

use-interpreted net function
Use interpreted arithmetic circuit instructions for the
net. Returns the instructions object.
use-join-tree net function
Use a join-tree to evaluate this net. Returns the join-tree object.
with-evidence (net &rest evidence) &body body function
Saves the existing evidence in the net and sets the evidence to
evidence. Restores the net to its previous state after leaving the
with-evidence block.
-Macros
with-evidence (net &rest evidence) &body body macro
Saves the existing evidence in the net and sets the evidence to
evidence. Restores the net to its previous state after leaving the
with-evidence block.
Generated by: CL-API
⚠️ **GitHub.com Fallback** ⚠️