BuildNetManifest: Builds a network manifest from a list of Pnets

BuildNetManifestR Documentation

Builds a network manifest from a list of Pnets

Description

A network manifest is a table of meta data about a colleciton of networks. Each line corresponds to the specific network. This manifest can be used by a network warehouse (Warehouse) to recreate the network on demand.

Usage

BuildNetManifest(Pnetlist)

Arguments

Pnetlist

A list of Pnet objects which will appear in the network manifest.

Details

A network manifest is a table (data frame) which describes a collection of networks. It contains meta-data about the networks, and not the information about the nodes, contained in the node manifest (BuildNodeManifest) or the relaitonships between the nodes which is contained in the Q-matrix (Pnet2Qmat) or the \Omega-Matrix (Pnet2Omega). The role of the net manifest is to be used as to create a Net Warehouse which is an argument to the Qmat2Pnet and Omega2Pnet commands, creating networks as they are referenced.

The “Name” column of the table contains the network name and is a key to the table (so it should be unique). It corresponds to PnetName. The “Title” (PnetTitle) and “Description” (PnetDescription) columns contain optional meta-data about the node. The “Pathname” (PnetPathname) column contiains the location of the file to which the network should be written and from which it can be read. The “Hub” (PnetHub) is for spoke models (evidence models) some of whose variables are defined in a hub network. This the network in question is meant to be a spoke, then this field points at the corresponding hub.

Value

An object of type data.frame where the columns have the following values.

Name

A character value giving the name of the network. This should be unique for each row and normally must conform to variable naming conventions. Corresponds to the function PnetName.

Title

An optional character value giving a longer human readable name for the netowrk. Corresponds to the function PnetTitle.

Hub

If this model is incomplete without being joined to another network, then the name of the hub network. Otherwise an empty character vector. Corresponds to the function PnetHub.

Pathname

The location of the file from which the network should be read or to which it should be written. Corresponds to the function PnetPathname.

Description

An optional character value documenting the purpose of the network. Corresponds to the function PnetDescription.

Note that the name column is regarded as a primary key to the table.

Logging

BuildNetManifest uses the flog.logger mechanism to log progress. To see progress messages, use flog.threshold(DEBUG) (or TRACE).

Author(s)

Russell Almond

References

Almond, R. G. (presented 2017, August). Tabular views of Bayesian networks. In John-Mark Agosta and Tomas Singlair (Chair), Bayeisan Modeling Application Workshop 2017. Symposium conducted at the meeting of Association for Uncertainty in Artificial Intelligence, Sydney, Australia. (International) Retrieved from http://bmaw2017.azurewebsites.net/

See Also

Network functions called to find network data: PnetName, PnetTitle, PnetPathname, PnetHub, PnetDescription

Used in the construction of Network Warehouses (see WarehouseManifest).

Similar to the function BuildNodeManifest.

Examples

## This provides an example network manifest.
netman1 <- read.csv(system.file("auxdata", "Mini-PP-Nets.csv", 
                                package="Peanut"),
                    row.names=1, stringsAsFactors=FALSE)

## Not run: 
library(PNetica)  ## Example requires PNetica

sess <- NeticaSession()
startSession(sess)

netpath <- System.file("testnets",package="PNetica")
netnames <- paste(c("miniPP-CM","PPcompEM","PPconjEM","PPtwostepEM",
                  "PPdurAttEM"),"dne",sep=".")


Nets <- ReadNetworks(file.path(netpath,netnames),
                     session=sess)

netman <- BuildNetManifest(Nets)
stopifnot(all.equal(netman,netman1))

## BNWarehouse is the PNetica Net Warehouse.
Nethouse <- BNWarehouse(manifest=netman1,session=sess,key="Name")

stopSession(sess)


## End(Not run)

ralmond/Peanut documentation built on Sept. 19, 2023, 8:27 a.m.