This function loads the Bayesian network from a native gRain object of class "grain" or an external file with extension .net (as provided from Hugin or GeNIe), then compiles the network if a target node of interest is given.
Usage
loadNetwork(network, target = NULL)
Arguments
network
The Bayesian network. An object of class "grain" (package gRain), or a character (the path to the ".net" file to be imported)
target
character. The node of interest to be modelled and mapped.
Value
An object of class "grain". The Bayesian network. If target argument is provided the network is compiled for a faster querying .
Details
Bayesian networks from the package "bnlearn" can be imported via the function
".net" file format as provided from Netica currently does not correspond to a valid Hugin .net file.
Argument target has default set to NULL, but if provided the network will be compiled based on it for faster querying.