MakePnet.NeticaBN: Creates a NeticaBN object which is also a Pnet

MakePnet.NeticaBNR Documentation

Creates a NeticaBN object which is also a Pnet

Description

This does the actual work of making a Pnet from the manifest description. It is typically called from WarehouseMake.

Usage

MakePnet.NeticaBN(sess, name, data, restoreOnly=FALSE)

Arguments

sess

The Netica session (NeticaSession) object in which the net will be created.

name

A character scalar with the name of the network. This should follow the IDname rules.

data

A list providing data and metadata about the network. See details.

restoreOnly

A logical flag. If true, will signal an error if the network file does not exist. If false, a new empty network will be created.

Details

This is a key piece of the Warehouse infrastructure. The idea is that a network can be constructed given a session, a name, and a collection of metadata. The metadata can be stored in a table which is the the manifest of the warehouse.

The current system expects the following fields in the data argument.

Hub

For a network which represents an evidence model (spoke), this is the name of the network to which it should be attached (the hub).

Title

This is a longer unconstrained name for the network.

Pathname

This is the location in which the .neta or .dne file which stores the network.

Description

This is a longer string describing the network.

These correspond to fields in the RNetica{NeticaBN} object.

Value

An object of class NeticaBN which is also in the Pnet abtract class.

Names and Truenames

The truename system is designed to implement the name restrictions inherent in Netica (see IDname) without imposing the same limits on the Peanut framework. This is done by adding a Truename field to the net object and then mangling the actual name to follow the Netica rules using the as.IDname function.

The object should be available from the warehouse via its truename, but it is best to stick to the Netica naming conventions for networks and nodes.

Note

There seem to be two use cases for this function (and WarehouseSupply from which it is called. During model construction, calling this function should create a new blank network. During scoring, it should load a prebuilt network and signal an error if the network is missing. The restoreOnly flag is designed to distinguish between these cases.

Author(s)

Russell Almond

See Also

RNetica Package: CreateNetwork, NeticaBN, IDname

Peanut Package: Warehouse, WarehouseMake

PNetica Pacakge BNWarehouse

Examples


sess <- NeticaSession()
startSession(sess)

anet <- MakePnet.NeticaBN(sess,"Anet",
                          list(Title="A Network",Hub="",
                               Description="A Sample Network."))

DeleteNetwork(anet)

netman1 <- read.csv(system.file("auxdata", "Mini-PP-Nets.csv", 
                                 package="Peanut"),
                    row.names=1, stringsAsFactors=FALSE)
## Build the first network (proficiency model)
miniPP <- MakePnet.NeticaBN(sess,"miniPP",netman1[1,,drop=FALSE])

DeleteNetwork(miniPP)
stopSession(sess)


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